diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2012-07-31 01:08:23 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-31 14:41:38 -0700 |
commit | 54764bb647b2e847c512acf8d443df965da35000 (patch) | |
tree | 3918f6f42679d0ebdcef230f28285f99d178be62 /net/decnet | |
parent | 5a0d513b622ee41e117fc37e26e27e8ef42e8dae (diff) | |
download | op-kernel-dev-54764bb647b2e847c512acf8d443df965da35000.zip op-kernel-dev-54764bb647b2e847c512acf8d443df965da35000.tar.gz |
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 'net/decnet')
-rw-r--r-- | net/decnet/dn_route.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 2671977..85a3604 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c @@ -184,12 +184,6 @@ static __inline__ unsigned int dn_hash(__le16 src, __le16 dst) return dn_rt_hash_mask & (unsigned int)tmp; } -static inline void dst_rcu_free(struct rcu_head *head) -{ - struct dst_entry *dst = container_of(head, struct dst_entry, rcu_head); - dst_free(dst); -} - static inline void dnrt_free(struct dn_route *rt) { call_rcu_bh(&rt->dst.rcu_head, dst_rcu_free); |