[Sheepdog] [PATCH] farm: refine the read_working_object() output

Liu Yuan namei.unix at gmail.com
Mon Apr 16 16:38:29 CEST 2012


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

When the object is not found in working direcotry, it not an error
case, we should retrofit the debug message to be more friendly

  read_working_object(362) failed to open /home/tailai.ly/shee \
  pdog/store/0/obj/00fd34af00000015: No such file or directory

		       |
		       V
  read_working_object(362) object fd34af00000015 not found

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/farm/farm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sheep/farm/farm.c b/sheep/farm/farm.c
index e502462..5c62d7e 100644
--- a/sheep/farm/farm.c
+++ b/sheep/farm/farm.c
@@ -359,7 +359,7 @@ static void *read_working_object(uint64_t oid, int length)
 
 	fd = open(path, O_RDONLY, def_fmode);
 	if (fd < 0) {
-		eprintf("failed to open %s: %m\n", path);
+		dprintf("object %"PRIx64" not found\n", oid);
 		goto out;
 	}
 
-- 
1.7.8.2




More information about the sheepdog mailing list