]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: do not activate spares for uninitialized member arrays
authorArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Thu, 15 Sep 2016 07:53:58 +0000 (09:53 +0200)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Thu, 15 Sep 2016 16:16:07 +0000 (12:16 -0400)
This fixes some issues when a member array is created with "missing"
devices in a container that has more devices than used in the member
array.

Reported-by: Yi Zhang <yizhan@redhat.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
super-intel.c

index 92817e9ec8752bdfbbe9a2fb97f38695436d35ae..032ef00057227811825179d94cafc9e304858e25 100644 (file)
@@ -7789,6 +7789,11 @@ static struct mdinfo *imsm_activate_spare(struct active_array *a,
                        IMSM_T_STATE_DEGRADED)
                return NULL;
 
+       if (get_imsm_map(dev, MAP_0)->map_state == IMSM_T_STATE_UNINITIALIZED) {
+               dprintf("imsm: No spare activation allowed. Volume is not initialized.\n");
+               return NULL;
+       }
+
        /*
         * If there are any failed disks check state of the other volume.
         * Block rebuild if the another one is failed until failed disks