]> git.hungrycats.org Git - linux/commitdiff
net: ratelimit warnings about dst entry refcount underflow or overflow
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fri, 17 Jul 2015 11:01:11 +0000 (14:01 +0300)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 Sep 2016 09:14:11 +0000 (11:14 +0200)
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: Jiri Slaby <jslaby@suse.cz>
net/core/dst.c

index c07070544e3f6093c67293804d8ec4e3731f1fb1..31344009de253042e09461287fba1a8dac8d1235 100644 (file)
@@ -282,7 +282,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 (!newrefcnt && unlikely(dst->flags & DST_NOCACHE))
                        call_rcu(&dst->rcu_head, dst_destroy_rcu);
        }