diff options
author | Yu Kuai <yukuai3@huawei.com> | 2023-05-29 15:28:23 +0200 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2023-10-26 23:24:28 +0200 |
commit | 4db8a3d452daaf2def41ca45c36e36c5781627ac (patch) | |
tree | 1f020093ed3d57438d47445483fdf58f39216daf /tests | |
parent | tests: add a regression test for raid456 deadlock (diff) | |
download | mdadm-4db8a3d452daaf2def41ca45c36e36c5781627ac.tar.xz mdadm-4db8a3d452daaf2def41ca45c36e36c5781627ac.zip |
tests: add a regression test that raid456 can't assemble
If recovery is interrupted and reshape is started, then this array can't
assemble anymore. The problem is supposed to be fixed by [1].
[1] https://lore.kernel.org/linux-raid/20230529031045.1760883-1-yukuai1@huaweicloud.com/
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/25raid456-reshape-while-recovery | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/25raid456-reshape-while-recovery b/tests/25raid456-reshape-while-recovery new file mode 100644 index 00000000..b9f871f2 --- /dev/null +++ b/tests/25raid456-reshape-while-recovery @@ -0,0 +1,32 @@ +devs="$dev0 $dev1 $dev2" + +set_up_test() +{ + mdadm -Cv -R -n 3 -l5 $md0 $devs --assume-clean --size=50M || die "create array failed" + mdadm -a $md0 $dev3 $dev4 || die "failed to bind new disk to array" + echo 1000 > /sys/block/md0/md/sync_speed_max +} + +clean_up_test() +{ + mdadm -S $md0 +} + +trap 'clean_up_test' EXIT + +set_up_test || die "set up test failed" + +# set up replacement +echo want_replacement > /sys/block/md0/md/rd0/state +sleep 1 + +# trigger reshape +echo frozen > /sys/block/md0/md/sync_action +mdadm --grow -l 6 $md0 +sleep 1 + +# reassemeble array +mdadm -S $md0 || die "can't stop array" +mdadm --assemble $md0 $devs $dev3 $dev4 || die "can't assemble array" + +exit 0 |