Skip to content

Commit

Permalink
net: ratelimit warnings about dst entry refcount underflow or overflow
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Konstantin Khlebnikov authored and David S. Miller committed Jul 21, 2015
1 parent b8a23e8 commit 8bf4ada
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/core/dst.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8bf4ada

Please sign in to comment.