rpms/kernel/F-7 linux-2.6-softmac-deadlock.patch,1.1,1.2
David Woodhouse (dwmw2)
fedora-extras-commits at redhat.com
Tue Jul 31 18:57:07 UTC 2007
Author: dwmw2
Update of /cvs/pkgs/rpms/kernel/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20050
Modified Files:
linux-2.6-softmac-deadlock.patch
Log Message:
updated patch
linux-2.6-softmac-deadlock.patch:
Index: linux-2.6-softmac-deadlock.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/linux-2.6-softmac-deadlock.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-softmac-deadlock.patch 31 Jul 2007 13:22:29 -0000 1.1
+++ linux-2.6-softmac-deadlock.patch 31 Jul 2007 18:57:04 -0000 1.2
@@ -1,59 +1,53 @@
-From mb at bu3sch.de Tue Jul 31 13:58:04 2007
-Return-path: <mb at bu3sch.de>
-Envelope-to: dwmw2 at baythorne.infradead.org
-Delivery-date: Tue, 31 Jul 2007 13:58:04 +0100
-Received: from [2001:4bd0:203e::1] (helo=pentafluge.infradead.org) by
- baythorne.infradead.org with esmtps (Exim 4.63 #1 (Red Hat Linux)) id
- 1IFrIa-0004Cs-DX for dwmw2 at baythorne.infradead.org; Tue, 31 Jul 2007
- 13:58:04 +0100
-Received: from static-ip-62-75-166-246.inaddr.intergenia.de
- ([62.75.166.246] helo=vs166246.vserver.de) by pentafluge.infradead.org with
- esmtps (Exim 4.63 #1 (Red Hat Linux)) id 1IFrIY-0003S8-NL for
- dwmw2 at infradead.org; Tue, 31 Jul 2007 13:58:03 +0100
-Received: from t1590.t.pppool.de ([89.55.21.144] helo=powermac.local) by
- vs166246.vserver.de with esmtpa (Exim 4.50) id 1IFrIU-0008UN-NY; Tue, 31
- Jul 2007 14:57:58 +0200
From: Michael Buesch <mb at bu3sch.de>
-To: David Woodhouse <dwmw2 at infradead.org>
-Subject: [PATCH] softmac: Fix deadlock of wx_set_essid with assoc work
-Date: Tue, 31 Jul 2007 14:57:33 +0200
-User-Agent: KMail/1.9.6
-Cc: linux-wireless at vger.kernel.org, John Linville <linville at tuxdriver.com>
-MIME-Version: 1.0
-Content-Type: text/plain; charset="us-ascii"
-Content-Disposition: inline
-Message-Id: <200707311457.33723.mb at bu3sch.de>
-X-Spam-Score: 0.0 (/)
-X-Evolution-Source: imap://dwmw2@pentafluge.infradead.org/
-Content-Transfer-Encoding: 8bit
+To: John Linville <linville at tuxdriver.com>
+Subject: [PATCH final] softmac: Fix deadlock of wx_set_essid with assoc work
+Date: Tue, 31 Jul 2007 20:41:04 +0200
The essid wireless extension does deadlock against the assoc mutex,
-as we don't unlock the assoc mutex.
+as we don't unlock the assoc mutex when flushing the workqueue, which
+also holds the lock.
Signed-off-by: Michael Buesch <mb at bu3sch.de>
--
-David, please test if this fixes your deadlock.
+David, please stresstest this.
+John, please apply this, if David reports success from his tests.
+John, please notify me when you applied this, so I can immediately
+send it to -stable.
Index: bu3sch-wireless-dev/net/ieee80211/softmac/ieee80211softmac_wx.c
===================================================================
---- bu3sch-wireless-dev.orig/net/ieee80211/softmac/ieee80211softmac_wx.c 2007-03-05 18:42:18.000000000 +0100
-+++ bu3sch-wireless-dev/net/ieee80211/softmac/ieee80211softmac_wx.c 2007-07-31 14:51:46.000000000 +0200
-@@ -98,9 +98,12 @@ ieee80211softmac_wx_set_essid(struct net
+--- bu3sch-wireless-dev.orig/net/ieee80211/softmac/ieee80211softmac_wx.c 2007-07-14 18:18:06.000000000 +0200
++++ bu3sch-wireless-dev/net/ieee80211/softmac/ieee80211softmac_wx.c 2007-07-31 20:30:08.000000000 +0200
+@@ -74,8 +74,8 @@ ieee80211softmac_wx_set_essid(struct net
+ struct ieee80211softmac_auth_queue_item *authptr;
+ int length = 0;
+
++check_assoc_again:
+ mutex_lock(&sm->associnfo.mutex);
+-
+ /* Check if we're already associating to this or another network
+ * If it's another network, cancel and start over with our new network
+ * If it's our network, ignore the change, we're already doing it!
+@@ -98,13 +98,18 @@ ieee80211softmac_wx_set_essid(struct net
cancel_delayed_work(&authptr->work);
sm->associnfo.bssvalid = 0;
sm->associnfo.bssfixed = 0;
- flush_scheduled_work();
sm->associnfo.associating = 0;
sm->associnfo.associated = 0;
-+ /* Unlock mutex, otherwise we deadlock with the assoc work handler. */
++ /* We must unlock to avoid deadlocks with the assoc workqueue
++ * on the associnfo.mutex */
+ mutex_unlock(&sm->associnfo.mutex);
+ flush_scheduled_work();
-+ mutex_lock(&sm->associnfo.mutex);
++ /* Avoid race! Check assoc status again. Maybe someone started an
++ * association while we flushed. */
++ goto check_assoc_again;
}
}
-
---
-Greetings Michael.
+-
+ sm->associnfo.static_essid = 0;
+ sm->associnfo.assoc_wait = 0;
+
More information about the fedora-extras-commits
mailing list