From: Hawrylewicz Czarnowski, Przemyslaw Date: Tue, 7 Dec 2010 06:44:21 +0000 (+0000) Subject: fix: mdadm -Ss for external metadata don't stop container X-Git-Tag: mdadm-3.2~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f4cdfd92729ba1309fd7a82f31cee0441f243dd;p=thirdparty%2Fmdadm.git fix: mdadm -Ss for external metadata don't stop container Sometimes (~50%) mdadm -Ss cannot stop container as mdmon opens its device and do not close it before exit(). The period between open and release of handle is too long and md is not able stop device. Releasing handle before exit does not block md. Signed-off-by: Przemyslaw Czarnowski Signed-off-by: NeilBrown --- diff --git a/monitor.c b/monitor.c index 59b41819..f166bc8f 100644 --- a/monitor.c +++ b/monitor.c @@ -525,6 +525,7 @@ static int wait_and_act(struct supertype *container, int nowait) remove_pidfile(container->devname); exit_now = 1; signal_manager(); + close(fd); exit(0); } }