aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2012-05-16 05:06:14 -0400
committerLuis Henriques <luis.henriques@canonical.com>2012-05-25 12:24:49 -0400
commit6fece98662dd5ebd51445139a9c1af8ec8aa68be (patch)
treedf3d071ce060f2a56e4e4398689d83e1af15e735
parent653a75cae2fb212010b87248c85ca1c66818e88f (diff)
MD: Add del_timer_sync to mddev_suspend (fix nasty panic)
BugLink: http://bugs.launchpad.net/bugs/1002880 commit 0d9f4f135eb6dea06bdcb7065b1e4ff78274a5e9 upstream. 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. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-rw-r--r--drivers/md/md.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index bc8342812d0..a2b3f21d8ad 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -348,6 +348,8 @@ void mddev_suspend(mddev_t *mddev)
348 synchronize_rcu(); 348 synchronize_rcu();
349 wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0); 349 wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0);
350 mddev->pers->quiesce(mddev, 1); 350 mddev->pers->quiesce(mddev, 1);
351
352 del_timer_sync(&mddev->safemode_timer);
351} 353}
352EXPORT_SYMBOL_GPL(mddev_suspend); 354EXPORT_SYMBOL_GPL(mddev_suspend);
353 355