aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-mpath.c
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2009-12-10 18:52:19 -0500
committerAlasdair G Kergon <agk@redhat.com>2009-12-10 18:52:19 -0500
commit6df400ab64c68fc4072a13019fc20fd7e3d51303 (patch)
tree69a9e9060b6c8ad87acc3514d4c8981767efb3b5 /drivers/md/dm-mpath.c
parent7c6664114b7342a36f14a6836564e865669b3cea (diff)
dm mpath: flush workqueues before suspend completes
This patch stops the remaining dm-mpath activity during the suspend sequence by flushing workqueues in postsuspend function. The current dm-mpath target may not be quiet even after suspend completes because some workqueues (e.g. device_handler's work, event handling) are not flushed during the suspend sequence, even though suspended devices/targets are supposed to be quiet in this state. Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r--drivers/md/dm-mpath.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index dce971dbdfa3..5b23f2df9bde 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -885,13 +885,18 @@ static int multipath_ctr(struct dm_target *ti, unsigned int argc,
885 return r; 885 return r;
886} 886}
887 887
888static void multipath_dtr(struct dm_target *ti) 888static void flush_multipath_work(void)
889{ 889{
890 struct multipath *m = (struct multipath *) ti->private;
891
892 flush_workqueue(kmpath_handlerd); 890 flush_workqueue(kmpath_handlerd);
893 flush_workqueue(kmultipathd); 891 flush_workqueue(kmultipathd);
894 flush_scheduled_work(); 892 flush_scheduled_work();
893}
894
895static void multipath_dtr(struct dm_target *ti)
896{
897 struct multipath *m = ti->private;
898
899 flush_multipath_work();
895 free_multipath(m); 900 free_multipath(m);
896} 901}
897 902
@@ -1261,6 +1266,11 @@ static void multipath_presuspend(struct dm_target *ti)
1261 queue_if_no_path(m, 0, 1); 1266 queue_if_no_path(m, 0, 1);
1262} 1267}
1263 1268
1269static void multipath_postsuspend(struct dm_target *ti)
1270{
1271 flush_multipath_work();
1272}
1273
1264/* 1274/*
1265 * Restore the queue_if_no_path setting. 1275 * Restore the queue_if_no_path setting.
1266 */ 1276 */
@@ -1567,13 +1577,14 @@ out:
1567 *---------------------------------------------------------------*/ 1577 *---------------------------------------------------------------*/
1568static struct target_type multipath_target = { 1578static struct target_type multipath_target = {
1569 .name = "multipath", 1579 .name = "multipath",
1570 .version = {1, 1, 0}, 1580 .version = {1, 1, 1},
1571 .module = THIS_MODULE, 1581 .module = THIS_MODULE,
1572 .ctr = multipath_ctr, 1582 .ctr = multipath_ctr,
1573 .dtr = multipath_dtr, 1583 .dtr = multipath_dtr,
1574 .map_rq = multipath_map, 1584 .map_rq = multipath_map,
1575 .rq_end_io = multipath_end_io, 1585 .rq_end_io = multipath_end_io,
1576 .presuspend = multipath_presuspend, 1586 .presuspend = multipath_presuspend,
1587 .postsuspend = multipath_postsuspend,
1577 .resume = multipath_resume, 1588 .resume = multipath_resume,
1578 .status = multipath_status, 1589 .status = multipath_status,
1579 .message = multipath_message, 1590 .message = multipath_message,