diff options
author | Zheng Qixing <zhengqixing@huawei.com> | 2025-07-07 15:54:12 +0800 |
---|---|---|
committer | Yu Kuai <yukuai3@huawei.com> | 2025-07-12 17:55:20 +0800 |
commit | c0ffeb648000acdc932da7a9d33fd65e9263c54c (patch) | |
tree | 6910d3484b0e0f4649882bb8df77722dd1cec288 /scripts/lib | |
parent | 3ec8db61e7852b0d0637483c8fd249533d701bff (diff) |
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 4b10a3bc67c1 ("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: 4b10a3bc67c1 ("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>
Diffstat (limited to 'scripts/lib')
0 files changed, 0 insertions, 0 deletions