[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100427.162721.199029490.davem@davemloft.net>
Date: Tue, 27 Apr 2010 16:27:21 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: mirqus@...il.com
Cc: shemminger@...tta.com, herbert@...dor.apana.org.au,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next] bridge: multicast router list manipulation
From: Michał Mirosław <mirqus@...il.com>
Date: Wed, 28 Apr 2010 01:11:52 +0200
> 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?
I think so, I've committed the following to net-next-2.6 to fix this,
thanks!
bridge: Use hlist_for_each_entry_rcu() in br_multicast_add_router()
Noticed by Michał Mirosław.
Signed-off-by: David S. Miller <davem@...emloft.net>
---
net/bridge/br_multicast.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index fcba313..e29c9b7 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1045,7 +1045,7 @@ static void br_multicast_add_router(struct net_bridge *br,
struct net_bridge_port *p;
struct hlist_node *n, *last = NULL;
- hlist_for_each_entry(p, n, &br->router_list, rlist) {
+ hlist_for_each_entry_rcu(p, n, &br->router_list, rlist) {
if ((unsigned long) port >= (unsigned long) p) {
hlist_add_before_rcu(n, &port->rlist);
return;
--
1.7.0.4
Powered by blists - more mailing lists