]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Mar 2017 23:02:27 +0000 (16:02 -0700)
commit4115e1e44522740dd2f4a533475e3dad2b95a080
treeeb2789ec1d0fc8a2c244a61c2489da6d3d08f230
parent606da385af48257d835b844abe0be1083906f941
net: use net->count to check whether a netns is alive or not

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: 3a140b34043e ("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>
net/core/net-sysfs.c