Commit bd431e7
committed
md: allow removing faulty rdev during resync
JIRA: https://issues.redhat.com/browse/RHEL-94433
commit c0ffeb6
Author: Zheng Qixing <zhengqixing@huawei.com>
Date: Mon Jul 7 15:54:12 2025 +0800
md: allow removing faulty rdev during resync
During RAID resync, faulty rdev cannot be removed and will result in
"Device or resource busy" error when attempting hot removal.
Reproduction steps:
mdadm -Cv /dev/md0 -l1 -n3 -e1.2 /dev/sd{b..d}
mdadm /dev/md0 -f /dev/sdb
mdadm /dev/md0 -r /dev/sdb
-> mdadm: hot remove failed for /dev/sdb: Device or resource busy
After commit 4b10a3b ("md: ensure resync is prioritized over
recovery"), when a device becomes faulty during resync, the
md_choose_sync_action() function returns early without calling
remove_and_add_spares(), preventing faulty device removal.
This patch extracts a helper function remove_spares() to support
removing faulty devices during RAID resync operations.
Fixes: 4b10a3b ("md: ensure resync is prioritized over recovery")
Signed-off-by: Zheng Qixing <zhengqixing@huawei.com>
Reviewed-by: Li Nan <linan122@huawei.com>
Link: https://lore.kernel.org/linux-raid/20250707075412.150301-1-zhengqixing@huaweicloud.com
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>1 parent af73b3b commit bd431e7
1 file changed
+17
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9485 | 9485 | | |
9486 | 9486 | | |
9487 | 9487 | | |
9488 | | - | |
9489 | | - | |
| 9488 | + | |
9490 | 9489 | | |
9491 | 9490 | | |
9492 | | - | |
9493 | 9491 | | |
9494 | 9492 | | |
9495 | | - | |
9496 | | - | |
9497 | | - | |
9498 | | - | |
9499 | 9493 | | |
9500 | 9494 | | |
9501 | 9495 | | |
| |||
9509 | 9503 | | |
9510 | 9504 | | |
9511 | 9505 | | |
| 9506 | + | |
| 9507 | + | |
| 9508 | + | |
| 9509 | + | |
| 9510 | + | |
| 9511 | + | |
| 9512 | + | |
| 9513 | + | |
| 9514 | + | |
| 9515 | + | |
| 9516 | + | |
| 9517 | + | |
| 9518 | + | |
| 9519 | + | |
| 9520 | + | |
9512 | 9521 | | |
9513 | 9522 | | |
9514 | 9523 | | |
| |||
9551 | 9560 | | |
9552 | 9561 | | |
9553 | 9562 | | |
| 9563 | + | |
9554 | 9564 | | |
9555 | 9565 | | |
9556 | 9566 | | |
| |||
0 commit comments