Commit 906ad93
Ming Lei
md: allow removing faulty rdev during resync
JIRA: https://issues.redhat.com/browse/RHEL-106845
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: Ming Lei <ming.lei@redhat.com>1 parent b3c083e commit 906ad93
1 file changed
+17
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9454 | 9454 | | |
9455 | 9455 | | |
9456 | 9456 | | |
9457 | | - | |
9458 | | - | |
| 9457 | + | |
9459 | 9458 | | |
9460 | 9459 | | |
9461 | | - | |
9462 | 9460 | | |
9463 | 9461 | | |
9464 | | - | |
9465 | | - | |
9466 | | - | |
9467 | | - | |
9468 | 9462 | | |
9469 | 9463 | | |
9470 | 9464 | | |
| |||
9478 | 9472 | | |
9479 | 9473 | | |
9480 | 9474 | | |
| 9475 | + | |
| 9476 | + | |
| 9477 | + | |
| 9478 | + | |
| 9479 | + | |
| 9480 | + | |
| 9481 | + | |
| 9482 | + | |
| 9483 | + | |
| 9484 | + | |
| 9485 | + | |
| 9486 | + | |
| 9487 | + | |
| 9488 | + | |
| 9489 | + | |
9481 | 9490 | | |
9482 | 9491 | | |
9483 | 9492 | | |
| |||
9520 | 9529 | | |
9521 | 9530 | | |
9522 | 9531 | | |
| 9532 | + | |
9523 | 9533 | | |
9524 | 9534 | | |
9525 | 9535 | | |
| |||
0 commit comments