[PATCH 5/9] imsm: FIX: Add array map state transition for failures during initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



During initialization disk failure can occur also. Add code for such case
in imsm_set_disk() to support such event.

Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
---

 super-intel.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 973b22f..217a196 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5718,6 +5718,25 @@ static int is_rebuilding(struct imsm_dev *dev)
 		return 0;
 }
 
+static int is_initializing(struct imsm_dev *dev)
+{
+	struct imsm_map *migr_map;
+
+	if (!dev->vol.migr_state)
+		return 0;
+
+	if (migr_type(dev) != MIGR_INIT)
+		return 0;
+
+	migr_map = get_imsm_map(dev, 1);
+
+	if (migr_map->map_state == IMSM_T_STATE_UNINITIALIZED)
+		return 1;
+
+	return 0;
+
+}
+
 static void update_recovery_start(struct intel_super *super,
 					struct imsm_dev *dev,
 					struct mdinfo *array)
@@ -6501,6 +6520,12 @@ static void imsm_set_disk(struct active_array *a, int n, int state)
 			super->updates_pending++;
 			break;
 		}
+		if (is_initializing(dev)) {
+			dprintf("while initialization.");
+			map->map_state = map_state;
+			super->updates_pending++;
+			break;
+		}
 	break;
 	case IMSM_T_STATE_FAILED: /* transition to failed state */
 		dprintf("failed: ");

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux