Message ID | 1317282414-13368-1-git-send-email-rongqing.li@windriver.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
On Thu, Sep 29, 2011 at 3:46 PM, <rongqing.li@windriver.com> wrote: > From: Roy.Li <rongqing.li@windriver.com> > > Delete rcu_read_lock, it is redundant. > > Signed-off-by: Roy.Li <rongqing.li@windriver.com> > --- > net/ipv6/ndisc.c | 3 --- > 1 files changed, 0 insertions(+), 3 deletions(-) > > diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c > index 9da6e02..dd633ff 100644 > --- a/net/ipv6/ndisc.c > +++ b/net/ipv6/ndisc.c > @@ -370,17 +370,14 @@ static int ndisc_constructor(struct neighbour *neigh) > struct neigh_parms *parms; > int is_multicast = ipv6_addr_is_multicast(addr); > > - rcu_read_lock(); > in6_dev = in6_dev_get(dev); > if (in6_dev == NULL) { > - rcu_read_unlock(); > return -EINVAL; > } > > parms = in6_dev->nd_parms; > __neigh_parms_put(neigh->parms); > neigh->parms = neigh_parms_clone(parms); > - rcu_read_unlock(); > > neigh->type = is_multicast ? RTN_MULTICAST : RTN_UNICAST; > if (!dev->header_ops) { > -- I think the rcu_read_lock protects in6_dev->nd_parms. Yan, Zheng -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 09/29/2011 04:16 PM, Yan, Zheng wrote: > I think the rcu_read_lock protects in6_dev->nd_parms. > It can not protect in6_dev->nd_parms. rcu_read_lock protects the data which is accessed by rcu_XXX, -Roy > Yan, Zheng
On Thu, Sep 29, 2011 at 4:25 PM, Rongqing Li <rongqing.li@windriver.com> wrote: > On 09/29/2011 04:16 PM, Yan, Zheng wrote: >> >> I think the rcu_read_lock protects in6_dev->nd_parms. >> > It can not protect in6_dev->nd_parms. > > rcu_read_lock protects the data which is accessed by rcu_XXX, > I'm confused, why does neigh_parms_release() use call_rcu() to release nd_parms. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 09/29/2011 04:52 PM, Yan, Zheng wrote: > On Thu, Sep 29, 2011 at 4:25 PM, Rongqing Li<rongqing.li@windriver.com> wrote: >> On 09/29/2011 04:16 PM, Yan, Zheng wrote: >>> >>> I think the rcu_read_lock protects in6_dev->nd_parms. >>> >> It can not protect in6_dev->nd_parms. >> >> rcu_read_lock protects the data which is accessed by rcu_XXX, >> > > I'm confused, why does neigh_parms_release() use call_rcu() to release nd_parms. > Same as idev, there is a reference on struct neigh_parms which protects them -Roy -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 9da6e02..dd633ff 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -370,17 +370,14 @@ static int ndisc_constructor(struct neighbour *neigh) struct neigh_parms *parms; int is_multicast = ipv6_addr_is_multicast(addr); - rcu_read_lock(); in6_dev = in6_dev_get(dev); if (in6_dev == NULL) { - rcu_read_unlock(); return -EINVAL; } parms = in6_dev->nd_parms; __neigh_parms_put(neigh->parms); neigh->parms = neigh_parms_clone(parms); - rcu_read_unlock(); neigh->type = is_multicast ? RTN_MULTICAST : RTN_UNICAST; if (!dev->header_ops) {