Skip to contentSkip to conversation

imsm: do not activate spares for uninitialized member arrays

PATCH Applied Artur Paszkiewicz 2 participants 2 messages Sep 15, 2016 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 super-intel.c | 5 +++++
 1 file changed, 5 insertions(+)
super-intel.c +5 -0
index 92817e9..032ef00 100644
@@ -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
Signature · 1 line
2.10.0
Applied
#1 lore raw
Quoted 9 lines · Artur Paszkiewicz

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.

---
 super-intel.c | 5 +++++
 1 file changed, 5 insertions(+)

Applied!

Thanks,
Jes

Quoted 16 lines
super-intel.c +5 -0
index 92817e9..032ef00 100644
@@ -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