[sheepdog] [PATCH stable-0.8] sheep: don't recycle VDI ID

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Fri Jun 6 04:41:31 CEST 2014


From: Hitoshi Mitake <mitake.hitoshi at gmail.com>

Recycling VDI IDs of deleted VDIs is a completely wrong idea. It
breaks relations between inode objects and data objects. For example,
it can cause a problem of corrupting cloned VDIs (see related
issue). This patch forbids the recycling.

Related issue:
https://bugs.launchpad.net/sheepdog-project/+bug/1317755

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 sheep/vdi.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index e82f486..105b406 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -556,13 +556,6 @@ static int fill_vdi_info_range(uint32_t left, uint32_t right,
 		if (ret != SD_RES_SUCCESS)
 			goto out;
 
-		if (vdi_is_deleted(inode)) {
-			/* Recycle the deleted inode for fresh vdi create */
-			if (!iocb->create_snapshot)
-				info->free_bit = i;
-			continue;
-		}
-
 		if (!strncmp(inode->name, name, sizeof(inode->name))) {
 			sd_debug("%s = %s, %u = %u", iocb->tag, inode->tag,
 				 iocb->snapid, inode->snap_id);
-- 
1.7.1




More information about the sheepdog mailing list