Commit 7202082b authored by Li Nan's avatar Li Nan Committed by Yu Kuai
Browse files

md: prevent incorrect update of resync/recovery offset



In md_do_sync(), when md_sync_action returns ACTION_FROZEN, subsequent
call to md_sync_position() will return MaxSector. This causes
'curr_resync' (and later 'recovery_offset') to be set to MaxSector too,
which incorrectly signals that recovery/resync has completed, even though
disk data has not actually been updated.

To fix this issue, skip updating any offset values when the sync action
is FROZEN. The same holds true for IDLE.

Fixes: 7d9f107a ("md: use new helpers in md_do_sync()")
Signed-off-by: default avatarLi Nan <linan122@huawei.com>
Link: https://lore.kernel.org/linux-raid/20250904073452.3408516-1-linan666@huaweicloud.com


Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
parent 93dec51e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment