When flush works belong a specific multipath, we flush workqueue only in necessary. (That's my first time to send a patch, please remind me if anything wrong) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index f7810cc..0f14732 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -1154,9 +1154,10 @@ static void flush_multipath_work(struct multipath *m) set_bit(MPATHF_PG_INIT_DISABLED, &m->flags); smp_mb__after_atomic(); - flush_workqueue(kmpath_handlerd); + if (atomic_read(&m->pg_init_in_progress)) + flush_workqueue(kmpath_handlerd); multipath_wait_for_pg_init_completion(m); - flush_workqueue(kmultipathd); + flush_work(&m->process_queued_bios); flush_work(&m->trigger_event); clear_bit(MPATHF_PG_INIT_DISABLED, &m->flags); -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel