imsm: do not activate spares for uninitialized member arrays

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>
This commit is contained in:
Artur Paszkiewicz 2016-09-15 09:53:58 +02:00 committed by Jes Sorensen
parent 474267015b
commit 83ca7d4527
1 changed files with 5 additions and 0 deletions

View 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