netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <amwang@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.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: Wed, 05 Jun 2013 13:23:19 +0800	[thread overview]
Message-ID: <1370409799.2609.7.camel@cr0> (raw)
In-Reply-To: <1370405222.24311.231.camel@edumazet-glaptop>

On Tue, 2013-06-04 at 21:07 -0700, Eric Dumazet wrote:
> On Wed, 2013-06-05 at 11:33 +0800, Cong Wang wrote:
> > +		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.
> 

Oops, rcu_read_lock should be taken for the whole life of 'idev'...

      reply	other threads:[~2013-06-05  5:23 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 ` [Patch net-next v1 1/3] igmp: avoid taking RTNL for ip_mc_find_dev() Eric Dumazet
2013-06-05  5:23   ` Cong Wang [this message]

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=1370409799.2609.7.camel@cr0 \
    --to=amwang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --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).