aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>2015-07-17 14:01:11 +0300
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:58:38 +0200
commitb7857fac4630af8bbc704ce87f2a742f1d04cbd9 (patch)
tree021966d42bbbbb805fac4820cbf070122b085652
parent599407ee6260bc95cdc37e5be12de235f9696517 (diff)
net: ratelimit warnings about dst entry refcount underflow or overflow
commit 8bf4ada2e21378816b28205427ee6b0e1ca4c5f1 upstream. Kernel generates a lot of warnings when dst entry reference counter overflows and becomes negative. That bug was seen several times at machines with outdated 3.10.y kernels. Most like it's already fixed in upstream. Anyway that flood completely kills machine and makes further debugging impossible. Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r--net/core/dst.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/dst.c b/net/core/dst.c
index 1bf6842b8..582b861ae 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -283,7 +283,9 @@ void dst_release(struct dst_entry *dst)
unsigned short nocache = dst->flags & DST_NOCACHE;
newrefcnt = atomic_dec_return(&dst->__refcnt);
- WARN_ON(newrefcnt < 0);
+ if (unlikely(newrefcnt < 0))
+ net_warn_ratelimited("%s: dst:%p refcnt:%d\n",
+ __func__, dst, newrefcnt);
if (!newrefcnt && unlikely(nocache))
call_rcu(&dst->rcu_head, dst_destroy_rcu);
}