[sheepdog] [PATCH stable-0.7 7/9] sheep: correct error code of vdi deletion

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Fri Jan 31 06:46:42 CET 2014


The previous refactoring commit (5e460b4d64441) broke QA 016. This
patch fixes the problem.

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 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index 2be5c69..5acf0ba 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -1053,6 +1053,8 @@ static int start_deletion(struct request *req, uint32_t vid)
 		 * if the VDI is a cloned VDI, delete its objects
 		 * no matter whether the VDI tree is clear.
 		 */
+		ret = SD_RES_SUCCESS;
+
 		if (cloned) {
 			di->delete_vid_array[0] = vid;
 			di->delete_vid_count = 1;
@@ -1060,7 +1062,6 @@ static int start_deletion(struct request *req, uint32_t vid)
 			sd_debug("snapshot chain has valid vdi, just mark vdi %"
 				 PRIx32 " as deleted.", di->target_vid);
 			delete_inode(di->target_vid);
-			ret = SD_RES_SUCCESS;
 			goto out;
 		}
 	}
-- 
1.7.10.4




More information about the sheepdog mailing list