]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdmon: make sure we set safe_mode on SIGTERM.
authorNeilBrown <neilb@suse.de>
Mon, 2 Sep 2013 02:08:44 +0000 (12:08 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 2 Sep 2013 02:08:44 +0000 (12:08 +1000)
Without this, array may not go clean and mdmon will then
not exit.

A safe_mode of '0' (which is the only one that is handled differently
by this patch) means "never switch to 'active_idle'".  We don't want
that when mdmon is stopping.

Signed-off-by: NeilBrown <neilb@suse.de>
managemon.c

index f40bbdb3022f43b126d31bba4209c653ffde41ce..fc8d1fe7e83127120b9e4562de011e7fc4566c0b 100644 (file)
@@ -494,7 +494,7 @@ static void manage_member(struct mdstat_ent *mdstat,
        if (a->container == NULL)
                return;
 
-       if (sigterm && a->info.safe_mode_delay > 1) {
+       if (sigterm && a->info.safe_mode_delay != 1) {
                sysfs_set_safemode(&a->info, 1);
                a->info.safe_mode_delay = 1;
        }