diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2015-05-08 21:07:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-11 10:50:16 -0400 |
commit | 140e807da12988e2a925fe029336e7bb67a8d4de (patch) | |
tree | d201af832973088bc2d6c91d9b1ef68e7332f3da /net/socket.c | |
parent | 80ba92fa1a92dea128283f69f55b02242e213650 (diff) | |
download | linux-140e807da12988e2a925fe029336e7bb67a8d4de.tar.gz linux-140e807da12988e2a925fe029336e7bb67a8d4de.tar.bz2 linux-140e807da12988e2a925fe029336e7bb67a8d4de.zip |
tun: Utilize the normal socket network namespace refcounting.
There is no need for tun to do the weird network namespace refcounting.
The existing network namespace refcounting in tfile has almost exactly
the same lifetime. So rewrite the code to use the struct sock network
namespace refcounting and remove the unnecessary hand rolled network
namespace refcounting and the unncesary tfile->net.
This change allows the tun code to directly call sock_put bypassing
sock_release and making SOCK_EXTERNALLY_ALLOCATED unnecessary.
Remove the now unncessary tun_release so that if anything tries to use
the sock_release code path the kernel will oops, and let us know about
the bug.
The macvtap code already uses it's internal socket this way.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/net/socket.c b/net/socket.c index 884e32997698..b5f1f43ed8f4 100644 --- a/net/socket.c +++ b/net/socket.c @@ -576,9 +576,6 @@ void sock_release(struct socket *sock) if (rcu_dereference_protected(sock->wq, 1)->fasync_list) pr_err("%s: fasync list not empty!\n", __func__); - if (test_bit(SOCK_EXTERNALLY_ALLOCATED, &sock->flags)) - return; - this_cpu_sub(sockets_in_use, 1); if (!sock->file) { iput(SOCK_INODE(sock)); |