Commit 8d355a4
md/raid10: Do not add spare disk when recovery fails
In raid10_sync_request(), if data cannot be read from any disk for
recovery, it will go to 'giveup' and let 'chunks_skipped' + 1. After
multiple 'giveup', when 'chunks_skipped >= geo.raid_disks', it will
return 'max_sector', indicating that the recovery has been completed.
However, the recovery is just aborted and the data remains inconsistent.
Fix it by setting mirror->recovery_disabled, which will prevent the spare
disk from being added to this mirror. The same issue also exists during
resync, it will be fixed afterwards.
Signed-off-by: Li Nan <linan122@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230602091839.743798-2-linan666@huaweicloud.com1 parent 4d8a575 commit 8d355a4
1 file changed
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3311 | 3311 | | |
3312 | 3312 | | |
3313 | 3313 | | |
| 3314 | + | |
3314 | 3315 | | |
3315 | 3316 | | |
3316 | 3317 | | |
| |||
3394 | 3395 | | |
3395 | 3396 | | |
3396 | 3397 | | |
3397 | | - | |
3398 | | - | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
3399 | 3413 | | |
3400 | 3414 | | |
3401 | 3415 | | |
| |||
3646 | 3660 | | |
3647 | 3661 | | |
3648 | 3662 | | |
| 3663 | + | |
| 3664 | + | |
3649 | 3665 | | |
3650 | 3666 | | |
3651 | 3667 | | |
| |||
0 commit comments