linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mdadm: fix reshape from RAID5 to RAID6 with backup file
@ 2021-01-20 20:05 Nigel Croxon
  2021-02-16 14:28 ` Nigel Croxon
  2021-02-26 22:06 ` Jes Sorensen
  0 siblings, 2 replies; 18+ messages in thread
From: Nigel Croxon @ 2021-01-20 20:05 UTC (permalink / raw)
  To: linux-raid, jes, xni

Reshaping a 3-disk RAID5 to 4-disk RAID6 will cause a hang of
the resync after the grow.

Adding a spare disk to avoid degrading the array when growing
is successful, but not successful when supplying a backup file
on the command line. If the reshape job is not already running,
set the sync_max value to max.

Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
---
 Grow.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Grow.c b/Grow.c
index 6b8321c..5c2512f 100644
--- a/Grow.c
+++ b/Grow.c
@@ -931,12 +931,15 @@ int start_reshape(struct mdinfo *sra, int already_running,
 	err = err ?: sysfs_set_num(sra, NULL, "sync_max", sync_max_to_set);
 	if (!already_running && err == 0) {
 		int cnt = 5;
+		int err2;
 		do {
 			err = sysfs_set_str(sra, NULL, "sync_action",
 					    "reshape");
-			if (err)
+			err2 = sysfs_set_str(sra, NULL, "sync_max",
+					    "max");
+			if (err || err2)
 				sleep(1);
-		} while (err && errno == EBUSY && cnt-- > 0);
+		} while (err && err2 && errno == EBUSY && cnt-- > 0);
 	}
 	return err;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread
[parent not found: <764426808.38181143.1615910368475.JavaMail.zimbra () redhat ! com>]

end of thread, other threads:[~2021-04-06 18:31 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 20:05 [PATCH] mdadm: fix reshape from RAID5 to RAID6 with backup file Nigel Croxon
2021-02-16 14:28 ` Nigel Croxon
2021-02-26 22:06 ` Jes Sorensen
2021-03-16 14:54   ` Tkaczyk, Mariusz
2021-03-16 15:21     ` Nigel Croxon
2021-03-16 15:51     ` Nigel Croxon
2021-03-16 15:59     ` Nigel Croxon
2021-03-17  8:34       ` Tkaczyk, Mariusz
     [not found] <764426808.38181143.1615910368475.JavaMail.zimbra () redhat ! com>
2021-03-22 16:21 ` Oleksandr Shchirskyi
2021-03-22 16:47   ` Nigel Croxon
2021-03-22 17:16   ` Nigel Croxon
2021-03-22 17:41     ` Oleksandr Shchirskyi
2021-03-23 16:36       ` Nigel Croxon
2021-03-23 20:58         ` Oleksandr Shchirskyi
2021-03-26 11:59           ` Nigel Croxon
2021-04-01 20:49             ` Jes Sorensen
2021-04-02  9:40               ` Oleksandr Shchirskyi
2021-04-06 18:31                 ` Jes Sorensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).