[PATCH 1/4] FIX: disks added beyond array should be counted during reshape

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

 



During expansion there is more working disks that array can have.
Disks with set raid_disk (not a spare disk) during reshape should be counted
to allow array state transition to read_only state.

Array reconfiguration to new geometry should be done before reshape will
be started.

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

 Assemble.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index 317be8b..4d41081 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1504,6 +1504,7 @@ int assemble_container_content(struct supertype *st, int mdfd,
 {
 	struct mdinfo *dev, *sra;
 	int working = 0, preexist = 0;
+	int expansion = 0;
 	struct map_ent *map = NULL;
 
 	sysfs_init(content, mdfd, 0);
@@ -1522,6 +1523,9 @@ int assemble_container_content(struct supertype *st, int mdfd,
 			working++;
 		else if (errno == EEXIST)
 			preexist++;
+		else if (dev->disk.raid_disk >= content->array.raid_disks &&
+			  content->reshape_active)
+			expansion++;
 	if (working == 0) {
 		close(mdfd);
 		return 1;/* Nothing new, don't try to start */
@@ -1532,7 +1536,8 @@ int assemble_container_content(struct supertype *st, int mdfd,
 		   content->uuid, chosen_name);
 
 	if (runstop > 0 ||
-		 (working + preexist) >= content->array.working_disks) {
+		 (working + preexist + expansion) >=
+			content->array.working_disks) {
 		int err;
 
 		switch(content->array.level) {
@@ -1566,6 +1571,9 @@ int assemble_container_content(struct supertype *st, int mdfd,
 					chosen_name, working + preexist);
 			if (preexist)
 				fprintf(stderr, " (%d new)", working);
+			if (expansion)
+				fprintf(stderr, " ( + %d for expansion)",
+					expansion);
 			fprintf(stderr, "\n");
 		}
 		if (!err)

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