Commit 65a18ec5 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller

[NETNS]: Add netns refcnt debug for kernel sockets.

Protocol control sockets and netlink kernel sockets should not prevent the
namespace stop request. They are initialized and disposed in a special way by
sk_change_net/sk_release_kernel.
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5d1e4468
...@@ -1314,7 +1314,7 @@ void sock_net_set(struct sock *sk, struct net *net) ...@@ -1314,7 +1314,7 @@ void sock_net_set(struct sock *sk, struct net *net)
static inline void sk_change_net(struct sock *sk, struct net *net) static inline void sk_change_net(struct sock *sk, struct net *net)
{ {
put_net(sock_net(sk)); put_net(sock_net(sk));
sock_net_set(sk, net); sock_net_set(sk, hold_net(net));
} }
extern void sock_enable_timestamp(struct sock *sk); extern void sock_enable_timestamp(struct sock *sk);
......
...@@ -1001,6 +1001,7 @@ void sk_release_kernel(struct sock *sk) ...@@ -1001,6 +1001,7 @@ void sk_release_kernel(struct sock *sk)
sock_hold(sk); sock_hold(sk);
sock_release(sk->sk_socket); sock_release(sk->sk_socket);
release_net(sock_net(sk));
sock_net_set(sk, get_net(&init_net)); sock_net_set(sk, get_net(&init_net));
sock_put(sk); sock_put(sk);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment