Re: [BUG net-next-2.6] fib: Some rcu warning

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Dumazet
Date: Wednesday, April 14, 2010 - 1:10 pm

Le mercredi 14 avril 2010 à 21:54 +0200, Eric Dumazet a écrit :

Here is the patch to remove this problem.

[PATCH] fib: suppress lockdep-RCU false positive in FIB trie.

Followup of commit 634a4b20

Allow tnode_get_child_rcu() to be called either under rcu_read_lock()
protection or with RTNL held.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 59a8387..c98f115 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -209,7 +209,9 @@ static inline struct node *tnode_get_child_rcu(struct tnode *tn, unsigned int i)
 {
 	struct node *ret = tnode_get_child(tn, i);
 
-	return rcu_dereference(ret);
+	return rcu_dereference_check(ret,
+				     rcu_read_lock_held() ||
+				     lockdep_rtnl_is_held());
 }
 
 static inline int tnode_child_length(const struct tnode *tn)


--
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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[BUG net-next-2.6] fib: Some rcu warning, Eric Dumazet, (Wed Apr 14, 12:54 pm)
Re: [BUG net-next-2.6] fib: Some rcu warning, Eric Dumazet, (Wed Apr 14, 1:10 pm)
Re: [BUG net-next-2.6] fib: Some rcu warning, Paul E. McKenney, (Wed Apr 14, 1:33 pm)
Re: [BUG net-next-2.6] fib: Some rcu warning, David Miller, (Wed Apr 14, 4:12 pm)