Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 500729

Summary: Deadlock when a uevent is blocked waiting for the queued I/O.
Product: Red Hat Enterprise Linux 5 Reporter: Tom Coughlan <coughlan>
Component: kernelAssignee: Mikuláš Patočka <mpatocka>
Status: CLOSED ERRATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.4CC: cward, dzickus, emcnabb, lvm-team, mgahagan, tao, vijayakumar
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 08:51:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom Coughlan 2009-05-13 20:24:22 UTC
The same workqueue is used both for sending uevents and processing queued I/O.
Deadlock has been reported in RHEL5 when sending a uevent was blocked waiting
for the queued I/O to be processed.  Use scheduled_work() for the asynchronous
uevents instead.

This is backport of fe9cf30eb8186ef267d1868dc9f12f2d0f40835a from 2.6.29-rc1.
Additional flush_scheduled_work() was added to avoid accessing freed memory
in case the device is destroyed before keventd dispatches the event (the same
fix for upstream is pending).

This may fix BZ 472790 as well. Awaiting test results. 

Signed-off-by: Mikulas Patocka <mpatocka>

diff -u -r -p linux-2.6.18.x86_64.p31/drivers/md/dm-mpath.c linux-2.6.18.x86_64/drivers/md/dm-mpath.c
--- linux-2.6.18.x86_64.p31/drivers/md/dm-mpath.c       2009-04-22 14:09:08.000000000 +0200
+++ linux-2.6.18.x86_64/drivers/md/dm-mpath.c   2009-05-08 14:33:58.000000000 +0200
@@ -856,6 +856,7 @@ static void multipath_dtr(struct dm_targ
 
        flush_workqueue(kmpath_handlerd);
        flush_workqueue(kmultipathd);
+       flush_scheduled_work();
        free_multipath(m);
 }
 
@@ -913,7 +914,7 @@ static int fail_path(struct pgpath *pgpa
        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);
@@ -955,7 +956,7 @@ static int reinstate_path(struct 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);
@@ -999,7 +1000,7 @@ static void bypass_pg(struct multipath *
 
        spin_unlock_irqrestore(&m->lock, flags);
 
-       queue_work(kmultipathd, &m->trigger_event);
+       schedule_work(&m->trigger_event);
 }
 
 /*
@@ -1029,7 +1030,7 @@ static int switch_pg_num(struct multipat
        }
        spin_unlock_irqrestore(&m->lock, flags);
 
-       queue_work(kmultipathd, &m->trigger_event);
+       schedule_work(&m->trigger_event);
        return 0;
 }

Comment 1 RHEL Program Management 2009-05-13 20:39:30 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 2 Don Zickus 2009-05-14 19:36:00 UTC
in kernel-2.6.18-148.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.

Comment 4 Don Zickus 2009-05-20 17:48:48 UTC
*** Bug 472790 has been marked as a duplicate of this bug. ***

Comment 5 Chris Ward 2009-07-03 18:43:56 UTC
~~ Attention - RHEL 5.4 Beta Released! ~~

RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner!

If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.

Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value.

Questions can be posted to this bug or your customer or partner representative.

Comment 9 errata-xmlrpc 2009-09-02 08:51:12 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2009-1243.html

Comment 10 Ben Marzinski 2010-07-27 19:27:45 UTC
*** Bug 476941 has been marked as a duplicate of this bug. ***