On Tuesday 26 June 2007 03:14, Johannes Berg wrote: > Got it. ieee80211_sta_config_auth is running off the workqueue and doing > rtnl_lock while ieee80211_if_shutdown is trying to flush the workqueue > with the rtnl lock held. Nice one, anybody have ideas how to fix? Why > does ieee80211_sta_config_auth need to take the rtnl anyway? > There is potential for racing with userspace without that lock, but it's not very likely or dangerous, and deadlocking is a whole lot worse. Patch attached to remove that locking for now until a better solution is found. Thanks, -Michael Wu
mac80211: remove rtnl locking in ieee80211_sta.c From: Michael Wu <flamingice@xxxxxxxxxxxx> The rtnl is held in ieee80211_sta.c to prevent some potential races with userspace. Unfortunately, it also has the potential for deadlocks on interface down. This patch removes the rtnl locking to eliminate the deadlocks. Signed-off-by: Michael Wu <flamingice@xxxxxxxxxxxx> --- net/mac80211/ieee80211_sta.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index 91b545c..4862797 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c @@ -25,7 +25,6 @@ #include <linux/wireless.h> #include <linux/random.h> #include <linux/etherdevice.h> -#include <linux/rtnetlink.h> #include <net/iw_handler.h> #include <asm/types.h> @@ -2073,12 +2072,9 @@ static int ieee80211_sta_config_auth(struct net_device *dev, struct ieee80211_sta_bss *bss, *selected = NULL; int top_rssi = 0, freq; - rtnl_lock(); - if (!ifsta->auto_channel_sel && !ifsta->auto_bssid_sel && !ifsta->auto_ssid_sel) { ifsta->state = IEEE80211_AUTHENTICATE; - rtnl_unlock(); ieee80211_sta_reset_auth(dev, ifsta); return 0; } @@ -2121,7 +2117,6 @@ static int ieee80211_sta_config_auth(struct net_device *dev, ieee80211_sta_set_bssid(dev, selected->bssid); ieee80211_rx_bss_put(dev, selected); ifsta->state = IEEE80211_AUTHENTICATE; - rtnl_unlock(); ieee80211_sta_reset_auth(dev, ifsta); return 0; } else { @@ -2132,7 +2127,6 @@ static int ieee80211_sta_config_auth(struct net_device *dev, } else ifsta->state = IEEE80211_DISABLED; } - rtnl_unlock(); return -1; }
Attachment:
pgpRT5VxvpxVY.pgp
Description: PGP signature