From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65F5FC282DD for ; Thu, 23 May 2019 19:14:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3CF24217D9 for ; Thu, 23 May 2019 19:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638871; bh=+o030PVkMDEq80ncXbZbWqQNFOFZ0EE82fJqik5Q8/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=M4AoMYjS5Ppot4L2R/oI4ssT8c7dfEqerwxb6LtF7iZcwS989XOgDfV9Oo5X2ajdf dmQ8Ue6lNl0+MUB5HhJTx5Iar3t8Ggg9LF6tiBjwMBq5KQy1ccvWPE9ANz7YXspdwG APwYsvkG0GAulJP16lDeJERVs7MhOjKbovnnhnQw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388739AbfEWTO0 (ORCPT ); Thu, 23 May 2019 15:14:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:48428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387948AbfEWTO0 (ORCPT ); Thu, 23 May 2019 15:14:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C70E20863; Thu, 23 May 2019 19:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638865; bh=+o030PVkMDEq80ncXbZbWqQNFOFZ0EE82fJqik5Q8/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JApW1tj4c1o06FYHMAG7DRpRSBMrqW0yWL2YTxSQjgsOmrbaLKgNUgTKzuQqd9oXU H6YeKApQicBGgy0xbDJrJq49JqIKa4oTspM1t3Y5YvatW1t6wnUaRQHCwa744a7vjU J5T+ECE/9B1lFOdGWFJbboQTIYDH96s1poMX0MoM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , syzbot , "David S. Miller" Subject: [PATCH 4.19 004/114] net: avoid weird emergency message Date: Thu, 23 May 2019 21:05:03 +0200 Message-Id: <20190523181731.877653557@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181731.372074275@linuxfoundation.org> References: <20190523181731.372074275@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eric Dumazet [ Upstream commit d7c04b05c9ca14c55309eb139430283a45c4c25f ] When host is under high stress, it is very possible thread running netdev_wait_allrefs() returns from msleep(250) 10 seconds late. This leads to these messages in the syslog : [...] unregister_netdevice: waiting for syz_tun to become free. Usage count = 0 If the device refcount is zero, the wait is over. Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/core/dev.c +++ b/net/core/dev.c @@ -8716,7 +8716,7 @@ static void netdev_wait_allrefs(struct n refcnt = netdev_refcnt_read(dev); - if (time_after(jiffies, warning_time + 10 * HZ)) { + if (refcnt && time_after(jiffies, warning_time + 10 * HZ)) { pr_emerg("unregister_netdevice: waiting for %s to become free. Usage count = %d\n", dev->name, refcnt); warning_time = jiffies;