[PATCH 04/11] imsm: FIX: Finalize degraded migration

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

 



Currently mdadm for IMSM can finalize not-degraded migration only.
Add support for IMSM  for migration finalization when array
are is degraded state.

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

 super-intel.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 7587c8c..a3ca78a 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -6417,20 +6417,24 @@ static void imsm_set_disk(struct active_array *a, int n, int state)
 		a->last_checkpoint = 0;
 	} else if (is_gen_migration(dev)) {
 		dprintf("imsm: Detected General Migration in state: ");
-		if (map_state == IMSM_T_STATE_NORMAL) {
-			end_migration(dev, map_state);
+
+		switch (map_state) {
+		case IMSM_T_STATE_NORMAL:
+			dprintf("normal\n");
+			if (a->last_checkpoint >= a->info.component_size)
+				end_migration(dev, map_state);
 			map = get_imsm_map(dev, 0);
 			map->failed_disk_num = ~0;
-			dprintf("normal\n");
-		} else {
-			if (map_state == IMSM_T_STATE_DEGRADED) {
-				printf("degraded\n");
+		break;
+		case IMSM_T_STATE_DEGRADED:
+			dprintf("degraded\n");
+			if (a->last_checkpoint >= a->info.component_size)
 				end_migration(dev, map_state);
-			} else {
-				dprintf("failed\n");
-			}
-			map->map_state = map_state;
+		break;
+		default:
+			dprintf("failed\n");
 		}
+		map->map_state = map_state;
 		super->updates_pending++;
 	}
 }

--
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