From: NeilBrown Date: Tue, 1 Feb 2011 03:44:02 +0000 (+1100) Subject: managemon: don't try to add spares when resync/recovery is happening. X-Git-Tag: mdadm-3.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f54a6742b2fc0f874cbb46f404aa4b4f94dad896;p=thirdparty%2Fmdadm.git managemon: don't try to add spares when resync/recovery is happening. kernel should reject this anyway, and we really should not be trying as it can only lead to confusion. Signed-off-by: NeilBrown --- diff --git a/managemon.c b/managemon.c index 269d06ed..63c97056 100644 --- a/managemon.c +++ b/managemon.c @@ -448,6 +448,12 @@ static void manage_member(struct mdstat_ent *mdstat, else frozen = 1; /* can't read metadata_version assume the worst */ + /* If sync_action is not 'idle' then don't try recovery now */ + if (!frozen + && sysfs_get_str(&a->info, NULL, "sync_action", buf, sizeof(buf)) > 0 + && strncmp(buf, "idle", 4) != 0) + frozen = 1; + if (mdstat->level) { int level = map_name(pers, mdstat->level); if (a->info.array.level != level && level >= 0) {