[sheepdog] [PATCH] md: correct partial plug failure handling

Liu Yuan namei.unix at gmail.com
Sat May 11 06:38:03 CEST 2013


From: Liu Yuan <tailai.ly at taobao.com>

If we plug multiple disks and some of them fail to purge directory, just call
md_del_disk and keep processing because successful plugging already add some
disks in the array.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/md.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sheep/md.c b/sheep/md.c
index 75143d2..6317044 100644
--- a/sheep/md.c
+++ b/sheep/md.c
@@ -610,11 +610,8 @@ static int do_plug_unplug(char *disks, bool plug)
 	path = strtok(disks, ",");
 	do {
 		if (plug) {
-			if (md_add_disk(path))
-				if (purge_directory(path) < 0) {
-					md_del_disk(path);
-					goto out;
-				}
+			if (md_add_disk(path) && purge_directory(path) < 0)
+				md_del_disk(path);
 		} else {
 			md_del_disk(path);
 		}
-- 
1.7.9.5




More information about the sheepdog mailing list