Skip to contentSkip to conversation

imsm: monitor: do not finish migration if there are no failed disks

PATCH Applied Pawel Baldysiak 3 participants 3 messages Apr 18, 2013 – Apr 22, 2013 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imsm: monitor: do not finish migration if there are no failed disks

From: Przemyslaw Czarnowski <[email protected]>

Transition from "degraded" to "recovery" made in OROM is slightly different than the same transision in mdadm. Missing disk is not removed from list of raid devices, but just from map. Therefore mdadm should not end migration basing on existence of list of missing disks but should rely on count of failed disks.

---
 super-intel.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
super-intel.c +8 -1
index 24016b7..3f15b0f 100644
@@ -6886,6 +6886,12 @@ static void handle_missing(struct intel_super *super, struct imsm_dev *dev)
 	if (!super->missing)
 		return;
 
+	/* When orom adds replacement for missing disk it does
+	 * not remove entry of missing disk, but just updates map with
+	 * new added disk. So it is not enough just to test if there is
+	 * any missing disk, we have to look if there are any failed disks
+	 * in map to stop migration */
+
 	dprintf("imsm: mark missing\n");
 	/* end process for initialization and rebuild only
 	 */
@@ -6896,7 +6902,8 @@ static void handle_missing(struct intel_super *super, struct imsm_dev *dev)
 		failed = imsm_count_failed(super, dev, MAP_0);
 		map_state = imsm_check_degraded(super, dev, failed, MAP_0);
 
-		end_migration(dev, super, map_state);
+		if (failed)
+			end_migration(dev, super, map_state);
 	}
 	for (dl = super->missing; dl; dl = dl->next)
 		mark_missing(dev, &dl->disk, dl->index);
#1 lore raw
Quoted 9 lines · Pawel

From: Przemyslaw Czarnowski
<[email protected]>

Transition from "degraded" to "recovery" made in OROM is slightly different than the same transision in mdadm. Missing disk is not removed from list of raid devices, but just from map. Therefore mdadm should not end migration basing on existence of list of missing disks but should rely on count of failed disks.

Quoted 3 lines

Signed-off-by: Przemyslaw Czarnowski
<[email protected]>

Adding author (Przemyslaw Czarnowski <[email protected]>) to CC.

--
Lukasz

Applied
#2 lore raw
In reply to Pawel Baldysiak
Quoted 33 lines · On Thu, 18 Apr 2013 10:51:37 +0200 Pawel Baldysiak <[email protected]>…

From: Przemyslaw Czarnowski <[email protected]>

Transition from "degraded" to "recovery" made in OROM is slightly different than the same transision in mdadm. Missing disk is not removed from list of raid devices, but just from map. Therefore mdadm should not end migration basing on existence of list of missing disks but should rely on count of failed disks.

---
 super-intel.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
super-intel.c +6 -0
index 24016b7..3f15b0f 100644
@@ -6886,6 +6886,12 @@ static void handle_missing(struct intel_super *super, struct imsm_dev *dev)
 	if (!super->missing)
 		return;
 
+	/* When orom adds replacement for missing disk it does
+	 * not remove entry of missing disk, but just updates map with
+	 * new added disk. So it is not enough just to test if there is
+	 * any missing disk, we have to look if there are any failed disks
+	 * in map to stop migration */
+
 	dprintf("imsm: mark missing\n");
 	/* end process for initialization and rebuild only
 	 */

super-intel.c static void handle_missing(struct intel_super *super, struct imsm_dev *dev) · line 6909

Quoted 9 lines
super-intel.c +2 -1
@@ -6896,7 +6902,8 @@ static void handle_missing(struct intel_super *super, struct imsm_dev *dev)
 		failed = imsm_count_failed(super, dev, MAP_0);
 		map_state = imsm_check_degraded(super, dev, failed, MAP_0);
 
-		end_migration(dev, super, map_state);
+		if (failed)
+			end_migration(dev, super, map_state);
 	}
 	for (dl = super->missing; dl; dl = dl->next)
 		mark_missing(dev, &dl->disk, dl->index);

applied, thanks.

NeilBrown