summaryrefslogtreecommitdiffstats
path: root/net/core/dst.c
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>2015-07-17 14:01:11 +0300
committerDavid S. Miller <davem@davemloft.net>2015-07-21 00:11:19 -0700
commit8bf4ada2e21378816b28205427ee6b0e1ca4c5f1 (patch)
treed0422c066f7e392f4fcbee512a2662cc4955f7da /net/core/dst.c
parentb8a23e8d8e31abeda2f6cfa36a772414b2a86ffc (diff)
downloadlinux-stable-8bf4ada2e21378816b28205427ee6b0e1ca4c5f1.tar.gz
linux-stable-8bf4ada2e21378816b28205427ee6b0e1ca4c5f1.tar.bz2
linux-stable-8bf4ada2e21378816b28205427ee6b0e1ca4c5f1.zip
net: ratelimit warnings about dst entry refcount underflow or overflow
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>
Diffstat (limited to 'net/core/dst.c')
-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 e956ce6d1378..002144bea935 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -284,7 +284,9 @@ void dst_release(struct dst_entry *dst)
int newrefcnt;
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 (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt)
call_rcu(&dst->rcu_head, dst_destroy_rcu);
}