make sure that the dhcp client (or other processes necessary to get a connection...
[openwrt.git] / package / mac80211 / patches / 407-debugfs-sta-work-fix.patch
1 Subject: mac80211: fix debugfs lockup
2
3 When debugfs_create_dir fails, sta_info_debugfs_add_work will not
4 terminate because it will find the same station again and again.
5 This is possible whenever debugfs fails for whatever reason; one
6 reason is a race condition in mac80211, unfortunately we cannot
7 do much about it, so just document it, it just means some station
8 may be missing from debugfs.
9
10 Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 Cc: Robin Holt <holt@sgi.com>
12 ---
13 net/mac80211/debugfs_sta.c | 11 +++++++++++
14 net/mac80211/sta_info.c | 7 ++++++-
15 net/mac80211/sta_info.h | 1 +
16 3 files changed, 18 insertions(+), 1 deletion(-)
17
18 --- everything.orig/net/mac80211/debugfs_sta.c 2008-10-07 20:05:29.000000000 +0200
19 +++ everything/net/mac80211/debugfs_sta.c 2008-10-07 20:06:39.000000000 +0200
20 @@ -249,11 +249,22 @@ void ieee80211_sta_debugfs_add(struct st
21 DECLARE_MAC_BUF(mbuf);
22 u8 *mac;
23
24 + sta->debugfs.add_has_run = true;
25 +
26 if (!stations_dir)
27 return;
28
29 mac = print_mac(mbuf, sta->sta.addr);
30
31 + /*
32 + * This might fail due to a race condition:
33 + * When mac80211 unlinks a station, the debugfs entries
34 + * remain, but it is already possible to link a new
35 + * station with the same address which triggers adding
36 + * it to debugfs; therefore, if the old station isn't
37 + * destroyed quickly enough the old station's debugfs
38 + * dir might still be around.
39 + */
40 sta->debugfs.dir = debugfs_create_dir(mac, stations_dir);
41 if (!sta->debugfs.dir)
42 return;
43 --- everything.orig/net/mac80211/sta_info.c 2008-10-07 20:05:29.000000000 +0200
44 +++ everything/net/mac80211/sta_info.c 2008-10-07 20:06:39.000000000 +0200
45 @@ -635,7 +635,12 @@ static void sta_info_debugfs_add_work(st
46
47 spin_lock_irqsave(&local->sta_lock, flags);
48 list_for_each_entry(tmp, &local->sta_list, list) {
49 - if (!tmp->debugfs.dir) {
50 + /*
51 + * debugfs.add_has_run will be set by
52 + * ieee80211_sta_debugfs_add regardless
53 + * of what else it does.
54 + */
55 + if (!tmp->debugfs.add_has_run) {
56 sta = tmp;
57 __sta_info_pin(sta);
58 break;
59 --- everything.orig/net/mac80211/sta_info.h 2008-10-07 20:05:29.000000000 +0200
60 +++ everything/net/mac80211/sta_info.h 2008-10-07 20:06:39.000000000 +0200
61 @@ -300,6 +300,7 @@ struct sta_info {
62 struct dentry *inactive_ms;
63 struct dentry *last_seq_ctrl;
64 struct dentry *agg_status;
65 + bool add_has_run;
66 } debugfs;
67 #endif
68
This page took 0.04307 seconds and 5 git commands to generate.