[Sheepdog] [PATCH] sheep: fix check of the return value of read_object()

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Mar 8 20:06:22 CET 2011


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

diff --git a/sheep/vdi.c b/sheep/vdi.c
index 114576f..6e21f7c 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -441,7 +441,7 @@ again:
 			  vid_to_vdi_oid(vid), (void *)&inode,
 			  SD_INODE_HEADER_SIZE, 0, sys->nr_sobjs);
 
-	if (ret != sizeof(inode)) {
+	if (ret != SD_INODE_HEADER_SIZE) {
 		eprintf("cannot find vdi object\n");
 		return 0;
 	}
@@ -473,7 +473,7 @@ next:
 			  vid_to_vdi_oid(vid), (void *)&inode,
 			  SD_INODE_HEADER_SIZE, 0, sys->nr_sobjs);
 
-	if (ret != sizeof(inode)) {
+	if (ret != SD_INODE_HEADER_SIZE) {
 		eprintf("cannot find vdi object\n");
 		return 0;
 	}
-- 
1.5.6.5




More information about the sheepdog mailing list