Skip to content

Commit 0d9f4f1

Browse files
jbrassowneilbrown
authored andcommitted
MD: Add del_timer_sync to mddev_suspend (fix nasty panic)
Use del_timer_sync to remove timer before mddev_suspend finishes. We don't want a timer going off after an mddev_suspend is called. This is especially true with device-mapper, since it can call the destructor function immediately following a suspend. This results in the removal (kfree) of the structures upon which the timer depends - resulting in a very ugly panic. Therefore, we add a del_timer_sync to mddev_suspend to prevent this. Cc: [email protected] Signed-off-by: NeilBrown <[email protected]>
1 parent 6508fdb commit 0d9f4f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/md/md.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ void mddev_suspend(struct mddev *mddev)
391391
synchronize_rcu();
392392
wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0);
393393
mddev->pers->quiesce(mddev, 1);
394+
395+
del_timer_sync(&mddev->safemode_timer);
394396
}
395397
EXPORT_SYMBOL_GPL(mddev_suspend);
396398

0 commit comments

Comments
 (0)