From: Johannes Berg <johannes@sipsolutions.net>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: Roopa Prabhu <roopa@cumulusnetworks.com>,
Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH] bridge: fix bridge netlink RCU usage
Date: Tue, 03 Mar 2015 14:33:44 +0100 [thread overview]
Message-ID: <1425389624.2450.44.camel@sipsolutions.net> (raw)
In-Reply-To: <1425389374-12568-1-git-send-email-johannes@sipsolutions.net>
On Tue, 2015-03-03 at 13:29 +0000, Johannes Berg wrote:
> @@ -26,12 +26,15 @@ static size_t br_get_link_af_size(const struct net_device *dev)
> {
> struct net_port_vlans *pv;
>
> - if (br_port_exists(dev))
> - pv = nbp_get_vlan_info(br_port_get_rtnl(dev));
> - else if (dev->priv_flags & IFF_EBRIDGE)
> + if (br_port_exists(dev)) {
> + rcu_read_lock();
> + pv = nbp_get_vlan_info(br_port_get_rcu(dev));
> + rcu_read_unlock();
Note that I'm not entirely sure about the locking for "pv" here. In this
patch I'm basically assuming that nbp_get_vlan_info() is safe in any
context, which actually seems rather unlikely.
This clearly gets rid of the lockdep complaint for me, but I'm not sure
it's actually safe.
johannes
next prev parent reply other threads:[~2015-03-03 13:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 13:29 [PATCH] bridge: fix bridge netlink RCU usage Johannes Berg
2015-03-03 13:33 ` Johannes Berg [this message]
2015-03-03 13:40 ` Eric Dumazet
2015-03-03 13:43 ` 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=1425389624.2450.44.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
--cc=stephen@networkplumber.org \
/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.