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>
This commit is contained in:
committed by
Alasdair G Kergon
parent
7c6664114b
commit
6df400ab64
@@ -885,13 +885,18 @@ static int multipath_ctr(struct dm_target *ti, unsigned int argc,
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void multipath_dtr(struct dm_target *ti)
|
static void flush_multipath_work(void)
|
||||||
{
|
{
|
||||||
struct multipath *m = (struct multipath *) ti->private;
|
|
||||||
|
|
||||||
flush_workqueue(kmpath_handlerd);
|
flush_workqueue(kmpath_handlerd);
|
||||||
flush_workqueue(kmultipathd);
|
flush_workqueue(kmultipathd);
|
||||||
flush_scheduled_work();
|
flush_scheduled_work();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void multipath_dtr(struct dm_target *ti)
|
||||||
|
{
|
||||||
|
struct multipath *m = ti->private;
|
||||||
|
|
||||||
|
flush_multipath_work();
|
||||||
free_multipath(m);
|
free_multipath(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1261,6 +1266,11 @@ static void multipath_presuspend(struct dm_target *ti)
|
|||||||
queue_if_no_path(m, 0, 1);
|
queue_if_no_path(m, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void multipath_postsuspend(struct dm_target *ti)
|
||||||
|
{
|
||||||
|
flush_multipath_work();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Restore the queue_if_no_path setting.
|
* Restore the queue_if_no_path setting.
|
||||||
*/
|
*/
|
||||||
@@ -1567,13 +1577,14 @@ out:
|
|||||||
*---------------------------------------------------------------*/
|
*---------------------------------------------------------------*/
|
||||||
static struct target_type multipath_target = {
|
static struct target_type multipath_target = {
|
||||||
.name = "multipath",
|
.name = "multipath",
|
||||||
.version = {1, 1, 0},
|
.version = {1, 1, 1},
|
||||||
.module = THIS_MODULE,
|
.module = THIS_MODULE,
|
||||||
.ctr = multipath_ctr,
|
.ctr = multipath_ctr,
|
||||||
.dtr = multipath_dtr,
|
.dtr = multipath_dtr,
|
||||||
.map_rq = multipath_map,
|
.map_rq = multipath_map,
|
||||||
.rq_end_io = multipath_end_io,
|
.rq_end_io = multipath_end_io,
|
||||||
.presuspend = multipath_presuspend,
|
.presuspend = multipath_presuspend,
|
||||||
|
.postsuspend = multipath_postsuspend,
|
||||||
.resume = multipath_resume,
|
.resume = multipath_resume,
|
||||||
.status = multipath_status,
|
.status = multipath_status,
|
||||||
.message = multipath_message,
|
.message = multipath_message,
|
||||||
|
Reference in New Issue
Block a user