[PATCH] mdadm reshape hangs on external grow chunk

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

 



After creating a raid array on top of a imsm container. Try to
grow the chunk size and the reshape will hang with zero progress.
The reason is the computation of sync_max_to_set value:
if (before_data_disks <= data_disks)
        sync_max_to_set = sra->reshape_progress / data_disks;
    else
        sync_max_to_set = (sra->component_size * data_disks
                       - sra->reshape_progress) / data_disks;

Can produce a zero result. Which is then used to set the maximum
sync value, causing zero progress to the reshape.  The change is to
test if the sync_max_to_set value is zero. And if so, set the sysfs
sync_max to "max".

Steps to Reproduce:
1. Create a container and RAID0 array
mdadm -CR /dev/md/imsm -e imsm -n2 /dev/nvme0n1 /dev/nvme1n1
mdadm -CR  /dev/md/vol -l0 --chunk=16 -n2 /dev/nvme0n1 /dev/nvme1n1
2. Wait for resync
3. Try to grow the chunk size
mdadm --grow /dev/md/vol --chunk=256

Signed-off-by: Nigel Croxon <ncroxon@xxxxxxxxxx>
---
 Grow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Grow.c b/Grow.c
index 0f07a894..6c5021bc 100644
--- a/Grow.c
+++ b/Grow.c
@@ -943,7 +943,7 @@ int start_reshape(struct mdinfo *sra, int already_running,
 	if (!already_running)
 		sysfs_set_num(sra, NULL, "sync_min", sync_max_to_set);
 
-        if (st->ss->external)
+        if (sync_max_to_set)
 		err = err ?: sysfs_set_num(sra, NULL, "sync_max", sync_max_to_set);
 	else
 		err = err ?: sysfs_set_str(sra, NULL, "sync_max", "max");
-- 
2.31.1




[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