[sheepdog] [PATCH stable-0.7 2/3] sheep: initialize vdi bitmap after completion of reading inode object

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Tue Aug 27 12:42:47 CEST 2013


Current init_objlist_and_vdi_bitmap() sets a bit of corresponding VDI
before initializing the VDI. This should be done after the
initialization for defensive purpose.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/plain_store.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sheep/plain_store.c b/sheep/plain_store.c
index 6a2ee56..e35a7e7 100644
--- a/sheep/plain_store.c
+++ b/sheep/plain_store.c
@@ -191,6 +191,7 @@ static int init_vdi_state(uint64_t oid, char *wd, uint32_t epoch)
 
 	add_vdi_state(oid_to_vid(oid), inode->nr_copies,
 		      vdi_is_snapshot(inode));
+	set_bit(oid_to_vid(oid), sys->vdi_inuse);
 
 	ret = SD_RES_SUCCESS;
 out:
@@ -206,7 +207,6 @@ static int init_objlist_and_vdi_bitmap(uint64_t oid, char *wd, uint32_t epoch,
 
 	if (is_vdi_obj(oid)) {
 		sd_debug("found the VDI object %" PRIx64, oid);
-		set_bit(oid_to_vid(oid), sys->vdi_inuse);
 		ret = init_vdi_state(oid, wd, epoch);
 		if (ret != SD_RES_SUCCESS)
 			return ret;
-- 
1.7.10.4




More information about the sheepdog mailing list