diff options
author | Eric Dumazet | 2012-07-31 03:08:23 +0200 |
---|---|---|
committer | David S. Miller | 2012-07-31 23:41:38 +0200 |
commit | 54764bb647b2e847c512acf8d443df965da35000 (patch) | |
tree | 3918f6f42679d0ebdcef230f28285f99d178be62 /include/net/ip_fib.h | |
parent | bridge: make port attributes const (diff) | |
download | kernel-qcow2-linux-54764bb647b2e847c512acf8d443df965da35000.tar.gz kernel-qcow2-linux-54764bb647b2e847c512acf8d443df965da35000.tar.xz kernel-qcow2-linux-54764bb647b2e847c512acf8d443df965da35000.zip |
ipv4: Restore old dst_free() behavior.
commit 404e0a8b6a55 (net: ipv4: fix RCU races on dst refcounts) tried
to solve a race but added a problem at device/fib dismantle time :
We really want to call dst_free() as soon as possible, even if sockets
still have dst in their cache.
dst_release() calls in free_fib_info_rcu() are not welcomed.
Root of the problem was that now we also cache output routes (in
nh_rth_output), we must use call_rcu() instead of call_rcu_bh() in
rt_free(), because output route lookups are done in process context.
Based on feedback and initial patch from David Miller (adding another
call_rcu_bh() call in fib, but it appears it was not the right fix)
I left the inet_sk_rx_dst_set() helper and added __rcu attributes
to nh_rth_output and nh_rth_input to better document what is going on in
this code.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip_fib.h')
-rw-r--r-- | include/net/ip_fib.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index e69c3a47153d..e521a03515b1 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -81,8 +81,8 @@ struct fib_nh { __be32 nh_gw; __be32 nh_saddr; int nh_saddr_genid; - struct rtable *nh_rth_output; - struct rtable *nh_rth_input; + struct rtable __rcu *nh_rth_output; + struct rtable __rcu *nh_rth_input; struct fnhe_hash_bucket *nh_exceptions; }; |