net: suppress lockdep-RCU false positive in FIB trie.
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 22 Mar 2010 01:01:05 +0000 (18:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Mar 2010 01:01:05 +0000 (18:01 -0700)
Allow fib_find_node() to be called either under rcu_read_lock()
protection or with RTNL held.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_trie.c

index af5d897928606df52c3f97483f860c934d2bf6fd..01ef8ba9025cd70c576787d1ec32eb22504f5042 100644 (file)
@@ -961,7 +961,9 @@ fib_find_node(struct trie *t, u32 key)
        struct node *n;
 
        pos = 0;
-       n = rcu_dereference(t->trie);
+       n = rcu_dereference_check(t->trie,
+                                 rcu_read_lock_held() ||
+                                 lockdep_rtnl_is_held());
 
        while (n != NULL &&  NODE_TYPE(n) == T_TNODE) {
                tn = (struct tnode *) n;