Re: [PATCH v3 07/13] md: update curr_resync_completed even when MD_RECOVERY_INTR is set
From: Yu Kuai
Date: Sat Jan 03 2026 - 05:33:58 EST
在 2025/12/15 11:04, linan666@xxxxxxxxxxxxxxx 写道:
> From: Li Nan<linan122@xxxxxxxxxx>
>
> An error sync IO may be done and sub 'recovery_active' while its
> error handling work is pending. This work sets 'recovery_disabled'
> and MD_RECOVERY_INTR, then later removes the bad disk without Faulty
> flag. If 'curr_resync_completed' is updated before the disk is removed,
> it could lead to reading from sync-failed regions.
>
> With the previous patch, error IO will set badblocks or mark rdev as
> Faulty, sync-failed regions are no longer readable. After waiting for
> 'recovery_active' to reach 0 (in the previous line), all sync IO has
> *completed*, regardless of whether MD_RECOVERY_INTR is set. Thus, the
> MD_RECOVERY_INTR check can be removed.
>
> Signed-off-by: Li Nan<linan122@xxxxxxxxxx>
> ---
> drivers/md/md.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Yu Kuai <yukuai@xxxxxxxxx>
--
Thansk,
Kuai