]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
fix: mdadm -Ss for external metadata don't stop container
authorHawrylewicz Czarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com>
Tue, 7 Dec 2010 06:44:21 +0000 (06:44 +0000)
committerNeilBrown <neilb@suse.de>
Tue, 7 Dec 2010 10:12:38 +0000 (21:12 +1100)
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 <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
monitor.c

index 59b4181954c24c0dc209e93c17c6ba391e2a4eab..f166bc8fd44b0b0140ed313e3720b4ffdd1b6764 100644 (file)
--- 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);
                }
        }