Skip to content

Commit c1fdc90

Browse files
committed
md: prevent incorrect update of resync/recovery offset
JIRA: https://issues.redhat.com/browse/RHEL-94433 commit 7202082 Author: Li Nan <linan122@huawei.com> Date: Thu Sep 4 15:34:52 2025 +0800 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: 7d9f107 ("md: use new helpers in md_do_sync()") Signed-off-by: Li Nan <linan122@huawei.com> Link: https://lore.kernel.org/linux-raid/20250904073452.3408516-1-linan666@huaweicloud.com Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
1 parent a0b3023 commit c1fdc90

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/md/md.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9151,6 +9151,11 @@ void md_do_sync(struct md_thread *thread)
91519151
}
91529152

91539153
action = md_sync_action(mddev);
9154+
if (action == ACTION_FROZEN || action == ACTION_IDLE) {
9155+
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
9156+
goto skip;
9157+
}
9158+
91549159
desc = md_sync_action_name(action);
91559160
mddev->last_sync_action = action;
91569161

0 commit comments

Comments
 (0)