summaryrefslogtreecommitdiff
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-07-12 20:27:42 +1000
committerNeil Brown <neilb@suse.de>2008-07-12 20:27:42 +1000
commit48561b014292e5052da3dc3df629c10d8531d7fd (patch)
treee3783538c3455e21f59163640b72c4a325257972 /mdadm.c
parentc7c149300b170656485f4ac10ed7cfbd4fd6d0bb (diff)
Improve shutdown for container-based arrays.
1/ close a race where multiple arrays disappear at once and monitor isn't woken up to find out that the last one has gone. 2/ "mdadm -Ss" needs to pause briefly for mdmon to exit.
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mdadm.c b/mdadm.c
index 8b4b5dff..6fe6b99f 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1257,6 +1257,16 @@ int main(int argc, char *argv[])
put_md_name(name);
}
+ /* This is a bit of a hack.
+ * When we stop an array in a container, it
+ * takes a moment for mdmon to let go.
+ * So just pause briefly incase that is
+ * happening. Maybe we should do something
+ * more deterministic via the socket.
+ */
+ if (progress && err)
+ usleep(50000);
+
} while (!last && err);
if (err) rv |= 1;
} else {