blob: a8e8ced9ad52c3eaf6c22742ef86d74d63dff2c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# sanity check array creation
ddf_check_hold() {
if mdadm --remove $1 $2; then
echo "$2 removal from $1 should have been blocked" >&2
cat /proc/mdstat >&2
mdadm -E $2
exit 1
fi
}
ddf_check_removal() {
if ! mdadm --remove $1 $2 ; then
echo "$2 removal from $1 should have succeeded" >&2
cat /proc/mdstat >&2
mdadm -E $2
exit 1
fi
}
. tests/env-ddf-template
num_disks=2
mdadm -CR $container -e ddf -n $num_disks $dev8 $dev9
ddf_check container $num_disks
# RAID0 + RAID1
size=9000
level=0
chunk=64
offset=0
layout=0
mdadm -CR $member0 $dev8 $dev9 -n $num_disks -l $level -z $size -c $chunk
ddf_check member $member0 $num_disks $level $size $((size*2)) $offset $chunk $layout
testdev $member0 $num_disks $size $chunk
offset=$(((size & ~(chunk - 1))))
size=4000
level=1
chunk=0
mdadm -CR $member1 $dev8 $dev9 -n $num_disks -l $level -z $size
ddf_check member $member1 $num_disks $level $size $size $offset $chunk $layout
testdev $member1 1 $size 1
check wait
mdadm -Ss
# RAID10 + RAID5
num_disks=4
mdadm -CR $container -e ddf -n $num_disks $dev8 $dev9 $dev10 $dev11
ddf_check container $num_disks
size=9000
level=10
chunk=64
offset=0
layout=2
mdadm -CR $member0 $dev8 $dev9 $dev10 $dev11 -n $num_disks -l $level -z $size -c $chunk
ddf_check member $member0 $num_disks $level $size $((size*2)) $offset $chunk $layout
testdev $member0 $((num_disks-2)) $size $chunk
offset=$(((size & ~(chunk - 1))))
size=4000
level=5
mdadm -CR $member1 $dev8 $dev9 $dev10 $dev11 -n $num_disks -l $level -z $size -c $chunk
ddf_check member $member1 $num_disks $level $size $((size*3)) $offset $chunk $layout
testdev $member1 $((num_disks-1)) $size $chunk
check wait
# FAIL / REBUILD
ddf_check_hold $container $dev8
mdadm --fail $member0 $dev8
mdadm --wait-clean --scan || true
ddf_check_removal $container $dev8
mdadm --add $container $dev12
check wait
ddf_check_hold $container $dev12
|