[Sheepdog] [PATCH v4 3/6] fix a bug of copies calculation in delete_one()

levin li levin108 at gmail.com
Thu May 3 12:25:46 CEST 2012


It tries to compare the nr_copies with inode->nr_copies,
but the inode has just been allocated, the nr_copies may
be zero or something random

Signed-off-by: levin li <xingke.lwp at taobao.com>
---
 sheep/vdi.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index 6965ad3..f240303 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -448,8 +448,6 @@ static void delete_one(struct work *work)
 	}
 
 	nr_copies = get_nr_copies(dw->vnodes);
-	if (nr_copies > inode->nr_copies)
-		nr_copies = inode->nr_copies;
 
 	ret = read_object(dw->vnodes, dw->epoch, vid_to_vdi_oid(vdi_id),
 			  (void *)inode, sizeof(*inode),
-- 
1.7.10




More information about the sheepdog mailing list