[Sheepdog] [PATCH 6/7] fix wrong error checks in fix_object_consistency()

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Apr 7 02:56:22 CEST 2011


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/store.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sheep/store.c b/sheep/store.c
index 9beb476..b78aeb3 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -780,7 +780,7 @@ static int fix_object_consistency(struct request *req, int idx)
 	hdr->opcode = SD_OP_READ_OBJ;
 	hdr->flags = 0;
 	ret = forward_read_obj_req(req, idx);
-	if (ret < 0) {
+	if (ret != SD_RES_SUCCESS) {
 		eprintf("failed to read object, %d\n", ret);
 		goto out;
 	}
@@ -789,7 +789,7 @@ static int fix_object_consistency(struct request *req, int idx)
 	hdr->flags = SD_FLAG_CMD_WRITE;
 	hdr->oid = oid;
 	ret = forward_write_obj_req(req, idx);
-	if (ret < 0) {
+	if (ret != SD_RES_SUCCESS) {
 		eprintf("failed to write object, %d\n", ret);
 		goto out;
 	}
@@ -832,7 +832,7 @@ void store_queue_request(struct work *work, int idx)
 		/* fix object consistency when we read the object for the first time */
 		if (req->check_consistency) {
 			ret = fix_object_consistency(req, idx);
-			if (ret < 0)
+			if (ret != SD_RES_SUCCESS)
 				goto out;
 		}
 
-- 
1.5.6.5




More information about the sheepdog mailing list