[sheepdog] [PATCH] gateway: print oid on error case

Liu Yuan namei.unix at gmail.com
Tue Mar 19 12:49:31 CET 2013


From: Liu Yuan <tailai.ly at taobao.com>

This would be helpful when sheep daemon is started without '-d'.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/gateway.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sheep/gateway.c b/sheep/gateway.c
index 0f6bfc1..e52e8cd 100644
--- a/sheep/gateway.c
+++ b/sheep/gateway.c
@@ -56,7 +56,8 @@ int gateway_read_obj(struct request *req)
 		if (ret == SD_RES_SUCCESS)
 			goto out;
 
-		sd_eprintf("local read fail %x", ret);
+		sd_eprintf("local read %"PRIx64" failed, %s", oid,
+			   sd_strerror(ret));
 		break;
 	}
 
@@ -203,7 +204,8 @@ again:
 
 		ret = rsp->result;
 		if (ret != SD_RES_SUCCESS) {
-			sd_eprintf("fail %"PRIx32, ret);
+			sd_eprintf("fail %"PRIx64", %s", req->rq.obj.oid,
+				   sd_strerror(ret));
 			err_ret = ret;
 		}
 		finish_one_write(wi, i);
@@ -299,7 +301,8 @@ static int gateway_forward_request(struct request *req)
 		ret = sheep_do_op_work(op, req);
 
 		if (ret != SD_RES_SUCCESS) {
-			sd_eprintf("fail to write local %"PRIx32, ret);
+			sd_eprintf("fail to write local %"PRIx64", %s", oid,
+				   sd_strerror(ret));
 			err_ret = ret;
 		}
 	}
-- 
1.7.9.5




More information about the sheepdog mailing list