From: NeilBrown Date: Mon, 2 Sep 2013 02:08:44 +0000 (+1000) Subject: mdmon: make sure we set safe_mode on SIGTERM. X-Git-Tag: mdadm-3.3~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e5e54cf820fef717085faece24c2e666b3649f2;p=thirdparty%2Fmdadm.git mdmon: make sure we set safe_mode on SIGTERM. 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 --- diff --git a/managemon.c b/managemon.c index f40bbdb3..fc8d1fe7 100644 --- a/managemon.c +++ b/managemon.c @@ -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; }