From: Mikulas Patocka <mpatocka@redhat.com> Date: Fri, 8 May 2009 18:38:41 -0400 Subject: [md] s390: I/O stall when performing random CHPID off/on Message-id: Pine.LNX.4.64.0905081835350.1316@hs20-bc2-1.build.redhat.com O-Subject: Re: FW: Re: [RHEL5 U3 PATCH 1/1] s390 - I/O stall when performing CHPID off/on random times on LPAR Bugzilla: 500729 RH-Acked-by: Alasdair G Kergon <agk@redhat.com> I'd commit this. It is the upstream patch + flush_scheduled_work() to avoid a crash. If it doesn't work and deadlocks again, please post the backtrace of this deadlock. Mikulas diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index d466fd6..6cac8a2 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -858,6 +858,7 @@ static void multipath_dtr(struct dm_target *ti) flush_workqueue(kmpath_handlerd); flush_workqueue(kmultipathd); + flush_scheduled_work(); free_multipath(m); } @@ -915,7 +916,7 @@ static int fail_path(struct pgpath *pgpath) dm_path_uevent(DM_UEVENT_PATH_FAILED, m->ti, pgpath->path.dev->name, m->nr_valid_paths); - queue_work(kmultipathd, &m->trigger_event); + schedule_work(&m->trigger_event); out: spin_unlock_irqrestore(&m->lock, flags); @@ -957,7 +958,7 @@ static int reinstate_path(struct pgpath *pgpath) dm_path_uevent(DM_UEVENT_PATH_REINSTATED, m->ti, pgpath->path.dev->name, m->nr_valid_paths); - queue_work(kmultipathd, &m->trigger_event); + schedule_work(&m->trigger_event); out: spin_unlock_irqrestore(&m->lock, flags); @@ -1001,7 +1002,7 @@ static void bypass_pg(struct multipath *m, struct priority_group *pg, spin_unlock_irqrestore(&m->lock, flags); - queue_work(kmultipathd, &m->trigger_event); + schedule_work(&m->trigger_event); } /* @@ -1031,7 +1032,7 @@ static int switch_pg_num(struct multipath *m, const char *pgstr) } spin_unlock_irqrestore(&m->lock, flags); - queue_work(kmultipathd, &m->trigger_event); + schedule_work(&m->trigger_event); return 0; }