[sheepdog] [PATCH stable-0.7 1/2] sheep: don't recycle VDI ID

Hitoshi Mitake mitake.hitoshi at gmail.com
Mon Jul 7 16:17:20 CEST 2014


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>

Conflicts:
	sheep/vdi.c
Conflicts were resolved by Hitoshi Mitake.
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/vdi.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index be30d8f..1839de7 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -541,13 +541,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, strlen(inode->name))) {
 			sd_debug("%s = %s, %u = %u", iocb->tag, inode->tag,
 				 iocb->snapid, inode->snap_id);
-- 
1.9.1




More information about the sheepdog mailing list