]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: FIX: Do not allow spare activation during rebuild
authorAdam Kwolek <adam.kwolek@intel.com>
Wed, 7 Dec 2011 12:58:07 +0000 (13:58 +0100)
committerNeilBrown <neilb@suse.de>
Thu, 8 Dec 2011 03:08:21 +0000 (14:08 +1100)
Do not allow for spare device activation while rebuild is in progress,
when additional degradation occur.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index c6509afffc06ecd1570f2334b26f784471d41dc9..973b22fc5bbb058ff5b28486f8dd5de1b838f347 100644 (file)
@@ -6784,6 +6784,14 @@ static struct mdinfo *imsm_activate_spare(struct active_array *a,
        if (imsm_reshape_blocks_arrays_changes(super))
                        return NULL;
 
+       /* Cannot activate another spare if rebuild is in progress already
+        */
+       if (is_rebuilding(dev)) {
+               dprintf("imsm: No spare activation allowed. "
+                       "Rebuild in progress already.\n");
+               return NULL;
+       }
+
        if (a->info.array.level == 4)
                /* No repair for takeovered array
                 * imsm doesn't support raid4