[PATCH 12/23] imsm: Finalize reshape after adding disks to array

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

 



(Online Capacity Expansion for IMSM)
When mdmon finalizes reshape it calls set_array_state() function. For imsm metadata
imsm_set_array_state() is called. It detects general migration finish and finalizes reshape by setting imsm disks.

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

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

diff --git a/super-intel.c b/super-intel.c index 34ddb65..9d1afe3 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -4662,6 +4662,8 @@ static void mark_missing(struct imsm_dev *dev, struct imsm_disk *disk, int idx)
 	memmove(&disk->serial[0], &disk->serial[1], MAX_RAID_SERIAL_LEN - 1);  }
 
+static void imsm_set_disk(struct active_array *a, int n, int state);
+
 /* Handle dirty -> clean transititions and resync.  Degraded and rebuild
  * states are handled in imsm_set_disk() with one exception, when a
  * resync is stopped due to a new failure this routine will set the @@ -4746,6 +4748,16 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
 			dev->vol.dirty = 1;
 		super->updates_pending++;
 	}
+
+	/* finalize online capacity expansion/reshape */
+	if ((a->curr_action != reshape) &&
+	    (a->prev_action == reshape)) {
+		struct mdinfo *mdi;
+
+		for (mdi = a->info.devs; mdi; mdi = mdi->next)
+			imsm_set_disk(a, mdi->disk.raid_disk, mdi->curr_state);
+	}
+
 	return consistent;
 }
 

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