bridge: Use RCU list primitive in __br_mdb_ip_get
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 5 Mar 2010 21:07:39 +0000 (21:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 7 Mar 2010 23:31:12 +0000 (15:31 -0800)
As Paul McKenney correctly pointed out, __br_mdb_ip_get needs
to use the RCU list walking primitive in order to work correctly
on platforms where data-dependency ordering is not guaranteed.

Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_multicast.c

index 8b258872eba8eb9be15d31ac57fd9368284e9906..a1ffe1582c9ac5fca588b3a958602a60e636c4e5 100644 (file)
@@ -38,7 +38,7 @@ static struct net_bridge_mdb_entry *__br_mdb_ip_get(
        struct net_bridge_mdb_entry *mp;
        struct hlist_node *p;
 
-       hlist_for_each_entry(mp, p, &mdb->mhash[hash], hlist[mdb->ver]) {
+       hlist_for_each_entry_rcu(mp, p, &mdb->mhash[hash], hlist[mdb->ver]) {
                if (dst == mp->addr)
                        return mp;
        }