diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2012-05-16 05:06:14 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-05-16 20:38:24 -0400 |
commit | 0d9f4f135eb6dea06bdcb7065b1e4ff78274a5e9 (patch) | |
tree | 3d0b8c398c1eda38bac6d3dd6ac1b22b518d26b4 /drivers/md/md.c | |
parent | 6508fdbf40a92fd7c19d32780ea33ce8e8362b93 (diff) |
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: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 477eb2e180c0..01233d855eb2 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -391,6 +391,8 @@ void mddev_suspend(struct mddev *mddev) | |||
391 | synchronize_rcu(); | 391 | synchronize_rcu(); |
392 | wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0); | 392 | wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0); |
393 | mddev->pers->quiesce(mddev, 1); | 393 | mddev->pers->quiesce(mddev, 1); |
394 | |||
395 | del_timer_sync(&mddev->safemode_timer); | ||
394 | } | 396 | } |
395 | EXPORT_SYMBOL_GPL(mddev_suspend); | 397 | EXPORT_SYMBOL_GPL(mddev_suspend); |
396 | 398 | ||