diff options
author | Eric Dumazet <edumazet@google.com> | 2019-05-16 08:09:57 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-11 12:23:43 +0200 |
commit | b2f72a43114261387b943fa1ba364e97acba6e59 (patch) | |
tree | 213410b68a35880d42050e01a9466f330cf83bdc /net | |
parent | 70064f7ea1005694a3898950bdce6b9ee3869ca3 (diff) | |
download | linux-stable-b2f72a43114261387b943fa1ba364e97acba6e59.tar.gz linux-stable-b2f72a43114261387b943fa1ba364e97acba6e59.tar.bz2 linux-stable-b2f72a43114261387b943fa1ba364e97acba6e59.zip |
net: avoid weird emergency message
[ 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 <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 49f78bce5795..500b7452c526 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6986,7 +6986,7 @@ static void netdev_wait_allrefs(struct net_device *dev) 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; |