Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Javier Cardona <javier@cozybit.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	Thomas Pedersen <thomas@cozybit.com>,
	devel@lists.open80211s.org, linux-wireless@vger.kernel.org,
	jlopex@gmail.com
Subject: Re: [PATCH v3 2/7] mac80211: Remove mesh paths when an interface is removed
Date: Tue, 30 Aug 2011 05:25:36 +0200	[thread overview]
Message-ID: <1314674736.4011.2.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1314674373.4011.0.camel@jlt3.sipsolutions.net> (sfid-20110830_051943_508795_3FC735FF)

On Tue, 2011-08-30 at 05:19 +0200, Johannes Berg wrote:
> On Mon, 2011-08-29 at 13:23 -0700, Javier Cardona wrote:
> 
> > +static void mpp_path_flush(struct ieee80211_sub_if_data *sdata)
> > +{
> > +	struct mesh_table *tbl;
> > +	struct mesh_path *mpath;
> > +	struct mpath_node *node;
> > +	struct hlist_node *p;
> > +	int i;
> > +
> > +	read_lock_bh(&pathtbl_resize_lock);
> > +	tbl = rcu_dereference_protected(mpp_paths,
> > +					lockdep_is_held(pathtbl_resize_lock));
> > +	for_each_mesh_entry(tbl, p, node, i) {
> > +		mpath = node->mpath;
> > +		if (mpath->sdata != sdata)
> > +			continue;
> > +		spin_lock_bh(&tbl->hashwlock[i]);
> > +		spin_lock_bh(&mpath->state_lock);
> > +		call_rcu(&node->rcu, mesh_path_node_reclaim);
> 
> Why is read_lock sufficient? Why is this even a r/w lock?

n/m, I thought about this again and also saw the explanation in patch 9,
definitely seems fine. It's just a little unusual to me to have
per-bucket locks as well :)

johannes


  reply	other threads:[~2011-08-30  3:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 20:23 [PATCH v3 0/7] mesh_fixes Javier Cardona
2011-08-29 20:23 ` [PATCH v3 1/7] mac80211: Fix RCU pointer dereference in mesh_path_discard_frame() Javier Cardona
2011-08-29 20:23 ` [PATCH v3 2/7] mac80211: Remove mesh paths when an interface is removed Javier Cardona
2011-08-30  3:19   ` Johannes Berg
2011-08-30  3:25     ` Johannes Berg [this message]
2011-08-29 20:23 ` [PATCH v3 3/7] mac80211: Improve mpath state locking Javier Cardona
2011-08-29 20:23 ` [PATCH v3 4/7] mac80211: Remove redundant mesh path expiration checks Javier Cardona
2011-08-29 20:23 ` [PATCH v3 5/7] mac80211: Don't iterate twice over all mpaths when once in sufficient Javier Cardona
2011-08-29 20:23 ` [PATCH v3 6/7] mac80211: Consolidate {mesh,mpp}_path_flush into one function Javier Cardona
2011-08-29 20:23 ` [PATCH v3 7/7] mac80211: Consolidate mesh path duplicated functions Javier Cardona

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=1314674736.4011.2.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=devel@lists.open80211s.org \
    --cc=javier@cozybit.com \
    --cc=jlopex@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=thomas@cozybit.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