[sheepdog] [PATCH 1/2] sheep: purge directory when plugging the new disk

Liu Yuan namei.unix at gmail.com
Sun May 5 12:51:09 CEST 2013


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

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

diff --git a/sheep/md.c b/sheep/md.c
index 5de777b..1b45a37 100644
--- a/sheep/md.c
+++ b/sheep/md.c
@@ -605,6 +605,9 @@ static int do_plug_unplug(char *disks, bool plug)
 	old_nr = md_nr_disks;
 	path = strtok(disks, ",");
 	do {
+		if (purge_directory(path) < 0)
+			goto out;
+
 		if (plug)
 			md_add_disk(path);
 		else
-- 
1.7.9.5




More information about the sheepdog mailing list