[PATCH 9/9] imsm: Proceed with second array reshape only for frozen container

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

 



In IMSM case container operation is set of array operations.
We have 2 cases:
1. reshape initiated by mdadm grow
2. continue reshape from checkpoint after i.e. reboot.

In first case we have continue reshape for next array.
In second case we cannot be sure that assembly procedure will assembly
arrays in required order, and can potentially have parallel reshapes.

Monitor cannot keep information for this because for raid0 it will not be started.
Difference between 2 cases is that. In first case we have frozen container,
so only for frozen container 2nd array reshape is allowed.

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

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

diff --git a/super-intel.c b/super-intel.c
index c465288..d3da6f9 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5076,10 +5076,22 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
 		struct active_array *aa = a->container->arrays;
 		int arrays_under_reshape = 0;
 		int array_counter = 0;
+		int frozen = 0;
+		char buf[PATH_MAX];
 
+		/* do not process next volume if container is not frozen.
+		 * 'not frozen' case can occure,
+		 * when array in migration state  is assembled
+		 */			/* do not process next volume if container is not frozen
+			 */
+
+		if (sysfs_get_str(&a->info, NULL, "metadata_version", buf, sizeof(buf)) > 0)
+			frozen = buf[9] == '-';
+		if (frozen == 0)
+			arrays_under_reshape = -1;
 		/* check if no other arrays is under reshape
 		 */
-		while (aa) {
+		while (aa && frozen) {
 			array_counter++;
 			/* when we have takeovered array even single array
 			 * can be initialized for reshape, if mdadm didn't

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