From: Jiri Slaby <jirislaby@gmail.com>
To: linville@tuxdriver.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiri Slaby <jirislaby@gmail.com>,
Michael Wu <flamingice@sourmilk.net>,
Johannes Berg <johannes@sipsolutions.net>,
Jiri Benc <jbenc@suse.cz>
Subject: [PATCH 1/2] mac80211: fix recursive locking in ieee80211_sta_expire
Date: Mon, 7 Apr 2008 21:53:48 +0200 [thread overview]
Message-ID: <1207598029-20000-1-git-send-email-jirislaby@gmail.com> (raw)
Hi,
it's against -mm, what's current mac80211 git tree? It seems that
-mm has fresher material, than wireless-2.6...
--
ieee80211_sta_expire grabs local->sta_lock and calls sta_info_unlink
which tries to grab the lock again. (make available) and use
__sta_info_unlink variant instead.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Michael Wu <flamingice@sourmilk.net>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Jiri Benc <jbenc@suse.cz>
---
net/mac80211/ieee80211_sta.c | 2 +-
net/mac80211/sta_info.c | 2 +-
net/mac80211/sta_info.h | 2 ++
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index f9cf2f1..cfe6fcc 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -3081,7 +3081,7 @@ static void ieee80211_sta_expire(struct net_device *dev, unsigned long exp_time)
if (time_after(jiffies, sta->last_rx + exp_time)) {
printk(KERN_DEBUG "%s: expiring inactive STA %s\n",
dev->name, print_mac(mac, sta->addr));
- sta_info_unlink(&sta);
+ __sta_info_unlink(&sta);
if (sta)
list_add(&sta->list, &tmp_list);
}
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index f708367..ba02b43 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -409,7 +409,7 @@ static struct sta_info *__sta_info_unpin(struct sta_info *sta)
return ret;
}
-static void __sta_info_unlink(struct sta_info **sta)
+void __sta_info_unlink(struct sta_info **sta)
{
struct ieee80211_local *local = (*sta)->local;
struct ieee80211_sub_if_data *sdata = (*sta)->sdata;
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 5e39a41..3a89b28 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -347,6 +347,8 @@ int sta_info_insert(struct sta_info *sta);
* has already unlinked it.
*/
void sta_info_unlink(struct sta_info **sta);
+/* no lock version */
+void __sta_info_unlink(struct sta_info **sta);
void sta_info_destroy(struct sta_info *sta);
void sta_info_set_tim_bit(struct sta_info *sta);
--
1.5.4.4
next reply other threads:[~2008-04-07 20:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-07 19:53 Jiri Slaby [this message]
2008-04-07 19:53 ` [PATCH 2/2] mac80211: fix defined but not used Jiri Slaby
2008-04-07 21:48 ` [PATCH 1/2] mac80211: fix recursive locking in ieee80211_sta_expire drago01
2008-04-08 14:29 ` Johannes Berg
2008-04-08 22:02 ` Jiri Slaby
2008-04-08 18:35 ` John W. Linville
2008-04-08 22:06 ` Jiri Slaby
2008-04-08 23:43 ` John W. Linville
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1207598029-20000-1-git-send-email-jirislaby@gmail.com \
--to=jirislaby@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=flamingice@sourmilk.net \
--cc=jbenc@suse.cz \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).