From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless <linux-wireless@vger.kernel.org>
Cc: Javier Cardona <javier@cozybit.com>,
"John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH] mac80211: remove pointless mesh path timer RCU code
Date: Thu, 12 May 2011 15:03:32 +0200 [thread overview]
Message-ID: <1305205412.3461.27.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1305203138.3461.24.camel@jlt3.sipsolutions.net> (sfid-20110512_142543_533404_D7A57FF6)
From: Johannes Berg <johannes.berg@intel.com>
The code here to RCU-dereference a pointer that's
on the stack is totally pointless, RCU isn't magic
(like say Java's weak references are), so the code
can't work like whoever wrote it thought it might.
Remove it so readers don't get confused. Note that
it seems that a bug is there anyway: I don't see
any code that cancels the timer when a mesh path
struct is destroyed.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/mesh_hwmp.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
--- a/net/mac80211/mesh_hwmp.c 2011-05-12 15:01:20.000000000 +0200
+++ b/net/mac80211/mesh_hwmp.c 2011-05-12 15:01:24.000000000 +0200
@@ -967,20 +967,11 @@ endlookup:
void mesh_path_timer(unsigned long data)
{
- struct ieee80211_sub_if_data *sdata;
- struct mesh_path *mpath;
+ struct mesh_path *mpath = (void *) data;
+ struct ieee80211_sub_if_data *sdata = mpath->sdata;
- rcu_read_lock();
- mpath = (struct mesh_path *) data;
- mpath = rcu_dereference(mpath);
- if (!mpath)
- goto endmpathtimer;
- sdata = mpath->sdata;
-
- if (sdata->local->quiescing) {
- rcu_read_unlock();
+ if (sdata->local->quiescing)
return;
- }
spin_lock_bh(&mpath->state_lock);
if (mpath->flags & MESH_PATH_RESOLVED ||
@@ -997,8 +988,6 @@ void mesh_path_timer(unsigned long data)
}
spin_unlock_bh(&mpath->state_lock);
-endmpathtimer:
- rcu_read_unlock();
}
void
next prev parent reply other threads:[~2011-05-12 13:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-12 12:25 mesh RCU issues Johannes Berg
2011-05-12 13:03 ` Johannes Berg [this message]
2011-05-12 22:26 ` Javier Cardona
2011-05-13 7:13 ` Johannes Berg
2011-05-13 20:28 ` Javier Cardona
2011-05-13 23:30 ` Johannes Berg
2011-05-14 0:00 ` Johannes Berg
2011-05-14 3:52 ` Javier Cardona
2011-05-14 8:24 ` Johannes Berg
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=1305205412.3461.27.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=javier@cozybit.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.