From patchwork Tue Jul 14 11:43:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 495047 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4EF2214076B for ; Tue, 14 Jul 2015 21:43:16 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex-team.ru header.i=@yandex-team.ru header.b=AP2XCG3D; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751674AbbGNLnM (ORCPT ); Tue, 14 Jul 2015 07:43:12 -0400 Received: from forward-corp1g.mail.yandex.net ([95.108.253.251]:50189 "EHLO forward-corp1g.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbbGNLnI (ORCPT ); Tue, 14 Jul 2015 07:43:08 -0400 Received: from smtpcorp1m.mail.yandex.net (smtpcorp1m.mail.yandex.net [77.88.61.150]) by forward-corp1g.mail.yandex.net (Yandex) with ESMTP id 2633436606AD; Tue, 14 Jul 2015 14:43:06 +0300 (MSK) Received: from smtpcorp1m.mail.yandex.net (localhost [127.0.0.1]) by smtpcorp1m.mail.yandex.net (Yandex) with ESMTP id D64842CA02BC; Tue, 14 Jul 2015 14:43:05 +0300 (MSK) Received: from unknown (unknown [2a02:6b8:0:408:55be:d924:24e7:8b42]) by smtpcorp1m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id BXOoC41BJW-h5TiWb3k; Tue, 14 Jul 2015 14:43:05 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1436874185; bh=cCFNIb41jwg0NntvGnYABjRYHs7SxrcrN26VTs2bsRQ=; h=Subject:From:To:Cc:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding; b=AP2XCG3DUrgwVyJ9F7lW5amC7MRPnK0RNZesLRxNK3NiONWjntJqKq0HWFwyP2EQs 7yh8gxIakI58YkQIShC5WtjQtyFHn3f5sSG3GEkAX/tupka8d7rgHqXt+oADxyKXMB B8OTcGhF1XrUjpnQxGr9GSzf7jLIgqVgdTDxBLGY= Authentication-Results: smtpcorp1m.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: [PATCH] net: stop endless flood about dst entry refcount underflow or overflow From: Konstantin Khlebnikov To: netdev@vger.kernel.org, "David S. Miller" Cc: Eric Dumazet Date: Tue, 14 Jul 2015 14:43:05 +0300 Message-ID: <20150714114305.17434.53731.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- net/core/dst.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); }