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.
if (pending_discard == discard_this)
pending_discard = NULL;
discard_this = NULL;
+ wakeup_monitor();
}
}
*/
remove_old();
while (pending_discard) {
- wakeup_monitor();
while (discard_this == NULL)
sleep(1);
remove_old();
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 {