Skip to content

Commit 35052bc

Browse files
Li Nansmb49
authored andcommitted
md: do not delete safemode_timer in mddev_suspend
BugLink: https://bugs.launchpad.net/bugs/2078428 [ Upstream commit a8768a1 ] The deletion of safemode_timer in mddev_suspend() is redundant and potentially harmful now. If timer is about to be woken up but gets deleted, 'in_sync' will remain 0 until the next write, causing array to stay in the 'active' state instead of transitioning to 'clean'. Commit 0d9f4f1 ("MD: Add del_timer_sync to mddev_suspend (fix nasty panic))" introduced this deletion for dm, because if timer fired after dm is destroyed, the resource which the timer depends on might have been freed. However, commit 0dd84b3 ("md: call __md_stop_writes in md_stop") added __md_stop_writes() to md_stop(), which is called before freeing resource. Timer is deleted in __md_stop_writes(), and the origin issue is resolved. Therefore, delete safemode_timer can be removed safely now. Signed-off-by: Li Nan <[email protected]> Reviewed-by: Yu Kuai <[email protected]> Signed-off-by: Song Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Koichiro Den <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent e972132 commit 35052bc

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/md/md.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,6 @@ void mddev_suspend(struct mddev *mddev)
509509
clear_bit_unlock(MD_ALLOW_SB_UPDATE, &mddev->flags);
510510
wait_event(mddev->sb_wait, !test_bit(MD_UPDATING_SB, &mddev->flags));
511511

512-
del_timer_sync(&mddev->safemode_timer);
513512
/* restrict memory reclaim I/O during raid array is suspend */
514513
mddev->noio_flag = memalloc_noio_save();
515514
}

0 commit comments

Comments
 (0)