From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:38826 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751555AbdCROTo (ORCPT ); Sat, 18 Mar 2017 10:19:44 -0400 Subject: Patch "net: use net->count to check whether a netns is alive or not" has been added to the 4.10-stable tree To: avagin@openvz.org, davem@davemloft.net, grawity@gmail.com, gregkh@linuxfoundation.org Cc: , From: Date: Sat, 18 Mar 2017 22:06:14 +0800 Message-ID: <1489845974382@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled net: use net->count to check whether a netns is alive or not to the 4.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-use-net-count-to-check-whether-a-netns-is-alive-or-not.patch and it can be found in the queue-4.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Sat Mar 18 22:03:53 CST 2017 From: Andrey Vagin Date: Sun, 12 Mar 2017 21:36:18 -0700 Subject: net: use net->count to check whether a netns is alive or not From: Andrey Vagin [ Upstream commit 91864f5852f9996210fad400cf70fb85af091243 ] The previous idea was to check whether a net namespace is in net_exit_list or not. It doesn't work, because net->exit_list is used in __register_pernet_operations and __unregister_pernet_operations where all namespaces are added to a temporary list to make cleanup in a error case, so list_empty(&net->exit_list) always returns false. Reported-by: Mantas Mikulėnas Fixes: 002d8a1a6c11 ("net: skip genenerating uevents for network namespaces that are exiting") Signed-off-by: Andrei Vagin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/net-sysfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -952,7 +952,7 @@ net_rx_queue_update_kobjects(struct net_ while (--i >= new_num) { struct kobject *kobj = &dev->_rx[i].kobj; - if (!list_empty(&dev_net(dev)->exit_list)) + if (!atomic_read(&dev_net(dev)->count)) kobj->uevent_suppress = 1; if (dev->sysfs_rx_queue_group) sysfs_remove_group(kobj, dev->sysfs_rx_queue_group); @@ -1370,7 +1370,7 @@ netdev_queue_update_kobjects(struct net_ while (--i >= new_num) { struct netdev_queue *queue = dev->_tx + i; - if (!list_empty(&dev_net(dev)->exit_list)) + if (!atomic_read(&dev_net(dev)->count)) queue->kobj.uevent_suppress = 1; #ifdef CONFIG_BQL sysfs_remove_group(&queue->kobj, &dql_group); @@ -1557,7 +1557,7 @@ void netdev_unregister_kobject(struct ne { struct device *dev = &(ndev->dev); - if (!list_empty(&dev_net(ndev)->exit_list)) + if (!atomic_read(&dev_net(ndev)->count)) dev_set_uevent_suppress(dev, 1); kobject_get(&dev->kobj); Patches currently in stable-queue which might be from avagin@openvz.org are queue-4.10/net-use-net-count-to-check-whether-a-netns-is-alive-or-not.patch