[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100427164412.791e4999@nehalam>
Date: Tue, 27 Apr 2010 16:44:12 -0700
From: Stephen Hemminger <shemminger@...tta.com>
To: David Miller <davem@...emloft.net>
Cc: mirqus@...il.com, herbert@...dor.apana.org.au,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next] bridge: multicast router list manipulation
On Tue, 27 Apr 2010 16:28:11 -0700 (PDT)
David Miller <davem@...emloft.net> wrote:
> From: Stephen Hemminger <shemminger@...tta.com>
> Date: Tue, 27 Apr 2010 16:25:30 -0700
>
> > On Wed, 28 Apr 2010 01:11:52 +0200
> > Michał Mirosław <mirqus@...il.com> wrote:
> >
> >> 2010/4/27 Stephen Hemminger <shemminger@...tta.com>:
> >> > I prefer that the hlist be only accessed through the hlist macro
> >> > objects. Explicit twiddling of links (especially with RCU) exposes
> >> > the code to future bugs.
> >> [...]
> >> > - port->rlist.pprev = h;
> >> > - port->rlist.next = p;
> >> > - rcu_assign_pointer(*h, &port->rlist);
> >> > - if (p)
> >> > - p->pprev = &port->rlist.next;
> >> > + hlist_for_each_entry(p, n, &br->router_list, rlist) {
> >>
> >> Shouldn't this be hlist_for_each_entry_rcu?
> >>
> >
> > This code should already be protected by br->multicast_lock
>
> But the adds et al. use RCU already, I think we should be consistent
> one way or another.
>
> I've already made Michał's suggested change to net-next-2.6, if you
> think _rcu() isn't necessary then trim it from all the hlist calls
> in this function.
Code that doesn't need rcu for traversal should not use it.
It just confuses things and implies that rcu_read_lock is held
which it is not in this code.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists