[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150714114305.17434.53731.stgit@buzz>
Date: Tue, 14 Jul 2015 14:43:05 +0300
From: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
To: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>
Cc: Eric Dumazet <edumazet@...gle.com>
Subject: [PATCH] net: stop endless flood about dst entry refcount underflow
or overflow
Kernel generates a lot of warnings when dst entry reference counter
overflows and becomes negative. This patch prints address of dst entry,
its refcount and then resets reference counter to INT_MAX/2.
That bug was seen several times at machines with outdated 3.10.y kernels.
Most like it's already fixed in upstream. Anyway flood of that warnings
completely kills machine and makes further debugging impossible.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
---
net/core/dst.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/dst.c b/net/core/dst.c
index e956ce6d1378..2ed91082b3cf 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -284,7 +284,8 @@ void dst_release(struct dst_entry *dst)
int newrefcnt;
newrefcnt = atomic_dec_return(&dst->__refcnt);
- WARN_ON(newrefcnt < 0);
+ if (WARN(newrefcnt < 0, "dst: %p refcnt: %d\n", dst, newrefcnt))
+ atomic_set(&dst->__refcnt, INT_MAX / 2);
if (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt)
call_rcu(&dst->rcu_head, dst_destroy_rcu);
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists