summaryrefslogtreecommitdiffstats
path: root/managemon.c
diff options
context:
space:
mode:
authorArtur Paszkiewicz <artur.paszkiewicz@intel.com>2019-02-22 10:15:45 +0100
committerJes Sorensen <jsorensen@fb.com>2019-02-28 21:46:01 +0100
commit69d084784de196acec8ab703cd1b379af211d624 (patch)
treeb0ded165db9cb429a8f067bd8df35bb68906a375 /managemon.c
parentmdadm/tests: add one test case for failfast of raid1 (diff)
downloadmdadm-69d084784de196acec8ab703cd1b379af211d624.tar.xz
mdadm-69d084784de196acec8ab703cd1b379af211d624.zip
mdmon: don't attempt to manage new arrays when terminating
When mdmon gets a SIGTERM, it stops managing arrays that are clean. If there is more that one array in the container and one of them is dirty and the clean one is still present in mdstat, mdmon will treat it as a new array and start managing it again. This leads to a cycle of remove_old() / manage_new() calls for the clean array, until the other one also becomes clean. Prevent this by not calling manage_new() if sigterm is set. Also, remove a check for sigterm in manage_new() because the condition will never be true. Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to '')
-rw-r--r--managemon.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/managemon.c b/managemon.c
index 101231c5..29b91bad 100644
--- a/managemon.c
+++ b/managemon.c
@@ -727,9 +727,7 @@ static void manage_new(struct mdstat_ent *mdstat,
dprintf("inst: %s action: %d state: %d\n", inst,
new->action_fd, new->info.state_fd);
- if (sigterm)
- new->info.safe_mode_delay = 1;
- else if (mdi->safe_mode_delay >= 50)
+ if (mdi->safe_mode_delay >= 50)
/* Normal start, mdadm set this. */
new->info.safe_mode_delay = mdi->safe_mode_delay;
else
@@ -803,7 +801,7 @@ void manage(struct mdstat_ent *mdstat, struct supertype *container)
break;
}
}
- if (a == NULL || !a->container)
+ if ((a == NULL || !a->container) && !sigterm)
manage_new(mdstat, container, a);
}
}