netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] FIB_TRIE: RCU refine
@ 2008-03-20  5:15 Wang Chen
  2008-03-20  5:19 ` David Miller
  2008-03-20 15:35 ` Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: Wang Chen @ 2008-03-20  5:15 UTC (permalink / raw)
  To: David S. Miller; +Cc: NETDEV

David, sorry to send this patch again.
I sent it yesterday, but seems that it was refused by
netdev maillist. I subscribed the mailist and send it
again.

On reader side, RCU list-traversal functions, such as
*list_for_each_entry_rcu(), should be within an RCU
read-side critical section.

Surround them by rcu_read_*lock().

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
 net/ipv4/fib_trie.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 1ff446d..092e02b 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -2416,6 +2416,7 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
 		seq_indent(seq, iter->depth);
 		seq_printf(seq, "  |-- %d.%d.%d.%d\n", NIPQUAD(val));
 
+		rcu_read_lock();
 		hlist_for_each_entry_rcu(li, node, &l->list, hlist) {
 			struct fib_alias *fa;
 
@@ -2433,6 +2434,7 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
 				seq_putc(seq, '\n');
 			}
 		}
+		rcu_read_unlock();
 	}
 
 	return 0;
-- 
WCN


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-21  0:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-20  5:15 [PATCH] FIB_TRIE: RCU refine Wang Chen
2008-03-20  5:19 ` David Miller
2008-03-20 15:35 ` Stephen Hemminger
2008-03-20 22:14   ` David Miller
2008-03-21  0:19   ` Wang Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).