From: Eric Dumazet <eric.dumazet@gmail.com>
To: Cong Wang <amwang@redhat.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [Patch net-next v1 1/3] igmp: avoid taking RTNL for ip_mc_find_dev()
Date: Tue, 04 Jun 2013 21:07:02 -0700 [thread overview]
Message-ID: <1370405222.24311.231.camel@edumazet-glaptop> (raw)
In-Reply-To: <1370403211-6851-1-git-send-email-amwang@redhat.com>
On Wed, 2013-06-05 at 11:33 +0800, Cong Wang wrote:
> From: Cong Wang <amwang@redhat.com>
>
> RCU is enough to protect ip_mc_find_dev().
>
> Cc: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
> ---
> net/ipv4/igmp.c | 48 ++++++++++++++++++------------------------------
> 1 files changed, 18 insertions(+), 30 deletions(-)
>
> diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
> index 450f625..d3218c0 100644
> --- a/net/ipv4/igmp.c
> +++ b/net/ipv4/igmp.c
> @@ -1433,7 +1433,6 @@ void ip_mc_destroy_dev(struct in_device *in_dev)
> }
> }
>
> -/* RTNL is locked */
> static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr)
> {
> struct net_device *dev = NULL;
> @@ -1459,8 +1458,10 @@ static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr)
> }
> }
> if (dev) {
> + rcu_read_lock();
> imr->imr_ifindex = dev->ifindex;
> - idev = __in_dev_get_rtnl(dev);
> + idev = __in_dev_get_rcu(dev);
> + rcu_read_unlock();
> }
> return idev;
> }
You must be kidding.
This is obviously wrong.
next prev parent reply other threads:[~2013-06-05 4:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-05 3:33 [Patch net-next v1 1/3] igmp: avoid taking RTNL for ip_mc_find_dev() Cong Wang
2013-06-05 3:33 ` [Patch net-next v1 2/3] igmp: fix return values of some functions Cong Wang
2013-06-05 3:33 ` [Patch net-next v1 3/3] igmp: convert RTNL lock to a spinlock Cong Wang
2013-06-05 3:52 ` Stephen Hemminger
2013-06-05 5:21 ` Cong Wang
2013-06-05 5:32 ` Cong Wang
2013-06-05 4:07 ` Eric Dumazet [this message]
2013-06-05 5:23 ` [Patch net-next v1 1/3] igmp: avoid taking RTNL for ip_mc_find_dev() Cong Wang
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=1370405222.24311.231.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.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 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).