Skip to content

Commit 7202082

Browse files
Li NanYuKuai-huawei
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/linux-raid/[email protected] Signed-off-by: Yu Kuai <[email protected]>
1 parent 93dec51 commit 7202082

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
@@ -9125,6 +9125,11 @@ void md_do_sync(struct md_thread *thread)
91259125
}
91269126

91279127
action = md_sync_action(mddev);
9128+
if (action == ACTION_FROZEN || action == ACTION_IDLE) {
9129+
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
9130+
goto skip;
9131+
}
9132+
91289133
desc = md_sync_action_name(action);
91299134
mddev->last_sync_action = action;
91309135

0 commit comments

Comments
 (0)