Commit 7b74857
md/raid1,raid10: Fix: Operation continuing on 0 devices.
Since commit 9a56784 ("md: allow last device to be forcibly
removed from RAID1/RAID10."), RAID1/10 arrays can now lose all rdevs.
Before that commit, losing the array last rdev or reaching the end of
the function without early return in raid{1,10}_error never occurred.
However, both situations can occur in the current implementation.
As a result, when mddev->fail_last_dev is set, a spurious pr_crit
message can be printed.
This patch prevents "Operation continuing" printed if the array
is not operational.
root@fedora:~# mdadm --create --verbose /dev/md0 --level=1 \
--raid-devices=2 /dev/loop0 /dev/loop1
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
mdadm: size set to 1046528K
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
root@fedora:~# echo 1 > /sys/block/md0/md/fail_last_dev
root@fedora:~# mdadm --fail /dev/md0 loop0
mdadm: set loop0 faulty in /dev/md0
root@fedora:~# mdadm --fail /dev/md0 loop1
mdadm: set device faulty failed for loop1: Device or resource busy
root@fedora:~# dmesg | tail -n 4
[ 1314.359674] md/raid1:md0: Disk failure on loop0, disabling device.
md/raid1:md0: Operation continuing on 1 devices.
[ 1315.506633] md/raid1:md0: Disk failure on loop1, disabling device.
md/raid1:md0: Operation continuing on 0 devices.
root@fedora:~#
Fixes: 9a56784 ("md: allow last device to be forcibly removed from RAID1/RAID10.")
Signed-off-by: Kenta Akagi <[email protected]>1 parent 2240d1e commit 7b74857
2 files changed
+10
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1785 | 1785 | | |
1786 | 1786 | | |
1787 | 1787 | | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
1788 | 1793 | | |
1789 | 1794 | | |
1790 | 1795 | | |
1791 | 1796 | | |
1792 | 1797 | | |
1793 | 1798 | | |
1794 | 1799 | | |
1795 | | - | |
1796 | | - | |
1797 | | - | |
1798 | | - | |
1799 | 1800 | | |
1800 | 1801 | | |
1801 | 1802 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2034 | 2034 | | |
2035 | 2035 | | |
2036 | 2036 | | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
2037 | 2042 | | |
2038 | | - | |
2039 | | - | |
2040 | | - | |
2041 | | - | |
2042 | 2043 | | |
2043 | 2044 | | |
2044 | 2045 | | |
| |||
0 commit comments