blob: 823dd6f72af10d350d642c7911d5bd4721fe4dd5 (
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
|
# create a simple mirror and check failfast flag works
mdadm -CR $md0 -e1.2 --level=raid1 --failfast -n2 $dev0 $dev1
check raid1
if grep -v failfast /sys/block/md0/md/rd*/state > /dev/null
then
die "failfast missing"
fi
# Removing works with the failfast flag
mdadm $md0 -f $dev0
mdadm $md0 -r $dev0
if grep -v failfast /sys/block/md0/md/rd1/state > /dev/null
then
die "failfast missing"
fi
# Adding works with the failfast flag
mdadm $md0 -a --failfast $dev0
check wait
if grep -v failfast /sys/block/md0/md/rd0/state > /dev/null
then
die "failfast missing"
fi
mdadm -S $md0
# Assembling works with the failfast flag
mdadm -A $md0 $dev0 $dev1
check raid1
if grep -v failfast /sys/block/md0/md/rd*/state > /dev/null
then
die "failfast missing"
fi
# Adding works with the nofailfast flag
mdadm $md0 -f $dev0
mdadm $md0 -r $dev0
mdadm $md0 -a --nofailfast $dev0
check wait
if grep failfast /sys/block/md0/md/rd0/state > /dev/null
then
die "failfast should be missing"
fi
# Assembling with one faulty slave works with the failfast flag
mdadm $md0 -f $dev0
mdadm $md0 -r $dev0
mdadm -S $md0
mdadm -A $md0 $dev0 $dev1
check raid1
mdadm -S $md0
# Spare works with the failfast flag
mdadm -CR $md0 -e1.2 --level=raid1 --failfast -n2 $dev0 $dev1
check raid1
mdadm $md0 -a --failfast $dev2
check wait
check spares 1
if grep -v failfast /sys/block/md0/md/rd*/state > /dev/null
then
die "failfast missing"
fi
# Grow works with the failfast flag
mdadm -G $md0 --raid-devices=3
check wait
if grep -v failfast /sys/block/md0/md/rd*/state > /dev/null
then
die "failfast missing"
fi
mdadm -S $md0
exit 0
|