]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
managemon: don't try to add spares when resync/recovery is happening.
authorNeilBrown <neilb@suse.de>
Tue, 1 Feb 2011 03:44:02 +0000 (14:44 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 1 Feb 2011 03:44:02 +0000 (14:44 +1100)
kernel should reject this anyway, and we really should not be trying
as it can only lead to confusion.

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

index 269d06ed58d8bfd2ac7183f8b5e564d6fd2f4ea4..63c97056bbcf0f05a778cbbade816cedf3c5797d 100644 (file)
@@ -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) {