提交 0d9f4f13 编写于 作者: J Jonathan Brassow 提交者: NeilBrown

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: stable@vger.kernel.org
Signed-off-by: NNeilBrown <neilb@suse.de>
上级 6508fdbf
...@@ -391,6 +391,8 @@ void mddev_suspend(struct mddev *mddev) ...@@ -391,6 +391,8 @@ void mddev_suspend(struct mddev *mddev)
synchronize_rcu(); synchronize_rcu();
wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0); wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0);
mddev->pers->quiesce(mddev, 1); mddev->pers->quiesce(mddev, 1);
del_timer_sync(&mddev->safemode_timer);
} }
EXPORT_SYMBOL_GPL(mddev_suspend); EXPORT_SYMBOL_GPL(mddev_suspend);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册