]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
net: use net->count to check whether a netns is alive or not
authorAndrey Vagin <avagin@openvz.org>
Mon, 13 Mar 2017 04:36:18 +0000 (21:36 -0700)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 22 Mar 2017 14:02:34 +0000 (08:02 -0600)
commit451d60736d468d3b2a3d5ddc5d73dde59174866e
tree7dce6848d64f560f0b1c1696d9665e05ada0d26f
parent45197b726088b942cd4a88e5028e04ef3810c93b
net: use net->count to check whether a netns is alive or not

BugLink: http://bugs.launchpad.net/bugs/1675032
[ 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 <grawity@gmail.com>
Fixes: 002d8a1a6c11 ("net: skip genenerating uevents for network namespaces that are exiting")
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
net/core/net-sysfs.c