]> 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>
Tue, 4 Apr 2017 07:26:00 +0000 (09:26 +0200)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 27 Apr 2017 13:04:09 +0000 (10:04 -0300)
commit4e8aaae71c5d2b4862b1b87545f4544cde153b21
treeda92eec13f846db08033115d2a754fd050353186
parentfafbcec87ee8c7e8d33894c11fda820b5ad70e0a
net: use net->count to check whether a netns is alive or not

BugLink: http://bugs.launchpad.net/bugs/1672144
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>
(back ported from commit 91864f5852f9996210fad400cf70fb85af091243)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Conflicts:
net/core/net-sysfs.c
Acked-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Marcelo Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/core/net-sysfs.c