]> git.ipfire.org Git - thirdparty/mdadm.git/blob - tests/07reshape5intr
Free map to avoid resource leak issues
[thirdparty/mdadm.git] / tests / 07reshape5intr
1
2 #
3 # test interrupting and restarting raid5 reshape.
4 set -x
5 devs="$dev1"
6 st=UU
7 for disks in 2 3 4 5
8 do
9 eval devs=\"$devs \$dev$disks\"
10 st=U$st
11 for d in $devs
12 do dd if=/dev/urandom of=$d bs=1024 || true
13 done
14
15 case $disks in
16 2 | 3) chunk=1024;;
17 4 ) chunk=512;;
18 5 ) chunk=256;;
19 esac
20
21 mdadm -CR $md0 -amd -l5 -c $chunk -n$disks --assume-clean $devs
22 mdadm $md0 --add $dev6
23 echo 20 > /proc/sys/dev/raid/speed_limit_min
24 echo 20 > /proc/sys/dev/raid/speed_limit_max
25 mdadm --grow $md0 -n $[disks+1]
26 check reshape
27 check state $st
28 mdadm --stop $md0
29 mdadm --assemble $md0 $devs $dev6
30 check reshape
31 echo 1000 > /proc/sys/dev/raid/speed_limit_min
32 echo 2000 > /proc/sys/dev/raid/speed_limit_max
33 check wait
34 while ! echo check > /sys/block/md0/md/sync_action; do sleep 0.1; done
35 check wait
36 mm=`cat /sys/block/md0/md/mismatch_cnt`
37 if [ $mm -gt 0 ]
38 then echo >&2 "ERROR mismatch_cnt non-zero : $mm" ; exit 1
39 fi
40 mdadm -S $md0
41 done