diff options
author | Yu Kuai <yukuai3@huawei.com> | 2023-05-29 15:28:26 +0200 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2023-10-26 23:24:28 +0200 |
commit | c6c7bce5a3064ac9d2956ae42ecab27f2e33dc2b (patch) | |
tree | 890de987505008eac4aaf0b86b603823c9cb1a59 | |
parent | tests: add a regression test that reshape can corrupt data (diff) | |
download | mdadm-c6c7bce5a3064ac9d2956ae42ecab27f2e33dc2b.tar.xz mdadm-c6c7bce5a3064ac9d2956ae42ecab27f2e33dc2b.zip |
tests: add a regression test for raid456 deadlock again
This is a regression test for commit ("md/raid5: fix a deadlock in the
case that reshape is interrupted").
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
-rw-r--r-- | tests/25raid456-reshape-deadlock | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/25raid456-reshape-deadlock b/tests/25raid456-reshape-deadlock new file mode 100644 index 00000000..bfa0cc56 --- /dev/null +++ b/tests/25raid456-reshape-deadlock @@ -0,0 +1,34 @@ +devs="$dev0 $dev1 $dev2" + +set_up_test() +{ + mdadm -Cv -R -n 3 -l5 $md0 $devs --size=50M || die "create array failed" + mdadm -a $md0 $dev3 || die "failed to bind new disk to array" + echo 1000 > /sys/block/md0/md/sync_speed_max +} + +clean_up_test() +{ + echo idle > /sys/block/md0/md/sync_action + mdadm -S $md0 +} + +trap 'clean_up_test' EXIT + +set_up_test || die "set up test failed" + +# trigger reshape +mdadm --grow -l 6 $md0 +sleep 1 + +# stop reshape +echo frozen > /sys/block/md0/md/sync_action + +# read accross reshape +dd if=$md0 of=/dev/NULL bs=1m count=100 iflag=direct &> /dev/null & +sleep 2 + +# suspend array +echo 1 > /sys/block/md0/md/suspend_lo + +exit 0 |