diff options
author | Nigel Croxon <ncroxon@redhat.com> | 2021-01-20 15:05:42 -0500 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2021-03-03 09:29:17 -0500 |
commit | 4ae96c802203ec3cfbb089240c56d61f7f4661b3 (patch) | |
tree | a157deca4505926ba249b672dd3ff836f260e2ea | |
parent | 1fe2e1007310778d0551d5c34317e5318507399d (diff) | |
download | mdadm-4ae96c802203ec3cfbb089240c56d61f7f4661b3.tar.gz |
mdadm: fix reshape from RAID5 to RAID6 with backup file
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>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
-rw-r--r-- | Grow.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; } |