aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-04-26 16:40:43 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-27 15:53:26 -0400
commit0b53ff2eadb1db6818894435f85989fb05d7e718 (patch)
tree6c7ecececdb6a094c68b4af122aed788648a2b13 /include/net/sock.h
parent18f9f1365dad1237072d360bc487d8c7a1cae532 (diff)
net: fix a lockdep rcu warning in __sk_dst_set()
__sk_dst_set() might be called while no state can be integrated in a rcu_dereference_check() condition. So use rcu_dereference_raw() to shutup lockdep warnings (if CONFIG_PROVE_RCU is set) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 86a8ca177a29..4081db86a352 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1236,8 +1236,11 @@ __sk_dst_set(struct sock *sk, struct dst_entry *dst)
1236 struct dst_entry *old_dst; 1236 struct dst_entry *old_dst;
1237 1237
1238 sk_tx_queue_clear(sk); 1238 sk_tx_queue_clear(sk);
1239 old_dst = rcu_dereference_check(sk->sk_dst_cache, 1239 /*
1240 lockdep_is_held(&sk->sk_dst_lock)); 1240 * This can be called while sk is owned by the caller only,
1241 * with no state that can be checked in a rcu_dereference_check() cond
1242 */
1243 old_dst = rcu_dereference_raw(sk->sk_dst_cache);
1241 rcu_assign_pointer(sk->sk_dst_cache, dst); 1244 rcu_assign_pointer(sk->sk_dst_cache, dst);
1242 dst_release(old_dst); 1245 dst_release(old_dst);
1243} 1246}