]> git.ipfire.org Git - thirdparty/mdadm.git/blame - tests/07revert-shrink
Free map to avoid resource leak issues
[thirdparty/mdadm.git] / tests / 07revert-shrink
CommitLineData
8f0ac9d7
N
1set -e -x
2
3# revert a reshape that is decreasing the number of devices,
4# raid5, raid6, and raid10
5
6bu=$targetdir/md-backup
7rm -f $bu
8# RAID5
9mdadm -CR --assume-clean $md0 -l5 -n5 $devlist4
10check raid5
11testdev $md0 4 $mdsize1 512
12mdadm --grow $md0 --array-size 56832
13testdev $md0 3 $mdsize1 512
14mdadm -G $md0 -n 4 --backup=$bu
15sleep 3
16mdadm -S $md0
17mdadm -A $md0 --update=revert-reshape $devlist4 --backup-file=$bu
18check wait
19check raid5
20fsck -f -n $md0
21testdev $md0 4 $mdsize1 512
22mdadm -S $md0
23
24#FIXME
25rm -f $bu
26# RAID6
27mdadm -CR --assume-clean $md0 -l6 -n5 $devlist4
28check raid6
29testdev $md0 3 $mdsize1 512
30mdadm --grow $md0 --array-size 37888
31testdev $md0 2 $mdsize1 512
32mdadm -G $md0 -n 4 --backup=$bu
33sleep 2
34mdadm -S $md0
35mdadm -A $md0 --update=revert-reshape $devlist4 --backup-file=$bu
36check wait
37check raid6
38fsck -f -n $md0
39testdev $md0 3 $mdsize1 512
40mdadm -S $md0
41
42# RAID10
43mdadm -CR --assume-clean $md0 -l10 -n6 $devlist5
44check raid10
45testdev $md0 3 $mdsize1 512
46mdadm --grow $md0 --array-size 36864
47testdev $md0 2 $mdsize1 512
48mdadm -G $md0 -n 4
49sleep 3
50mdadm -S $md0
51mdadm -A $md0 --update=revert-reshape $devlist5
52check wait
53check raid10
54fsck -f -n $md0
55testdev $md0 3 $mdsize1 512
56mdadm -S $md0