Commit:     0d89d7944fead211422e21fb7ea70ed3b903a79e
Parent:     5c5482266537fdb24d6b8462540d8f65a6007a97
Author:     Eric Dumazet <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 10 22:35:21 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Jan 10 22:35:21 2008 -0800

    [DECNET] ROUTE: fix rcu_dereference() uses in /proc/net/decnet_cache
    In dn_rt_cache_get_next(), no need to guard seq->private by a
    rcu_dereference() since seq is private to the thread running this
    function. Reading seq.private once (as guaranted bu rcu_dereference())
    or several time if compiler really is dumb enough wont change the
    But we miss real spots where rcu_dereference() are needed, both in
    dn_rt_cache_get_first() and dn_rt_cache_get_next()
    Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
 net/decnet/dn_route.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 66663e5..0e10ff2 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1665,12 +1665,12 @@ static struct dn_route *dn_rt_cache_get_first(struct 
seq_file *seq)
-       return rt;
+       return rcu_dereference(rt);
 static struct dn_route *dn_rt_cache_get_next(struct seq_file *seq, struct 
dn_route *rt)
-       struct dn_rt_cache_iter_state *s = rcu_dereference(seq->private);
+       struct dn_rt_cache_iter_state *s = seq->private;
        rt = rt->u.dst.dn_next;
        while(!rt) {
@@ -1680,7 +1680,7 @@ static struct dn_route *dn_rt_cache_get_next(struct 
seq_file *seq, struct dn_rou
                rt = dn_rt_hash_table[s->bucket].chain;
-       return rt;
+       return rcu_dereference(rt);
 static void *dn_rt_cache_seq_start(struct seq_file *seq, loff_t *pos)
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to