diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2021-08-24 17:38:17 +0200 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2021-08-27 22:36:21 +0200 |
commit | 0a6ff58edbfb26469a095ab964095506352fc960 (patch) | |
tree | 5ede897a2f5e01121851899b7c1965fb1f4b275b /net/sunrpc | |
parent | NFSv4.2: remove restriction of copy size for inter-server copy. (diff) | |
download | linux-0a6ff58edbfb26469a095ab964095506352fc960.tar.xz linux-0a6ff58edbfb26469a095ab964095506352fc960.zip |
SUNRPC: Simplify socket shutdown when not reusing TCP ports
If we're not required to reuse the TCP port, then we can just
immediately close the socket, and leave the cleanup details to the TCP
layer.
Fixes: e6237b6feb37 ("NFSv4.1: Don't rebind to the same source port when reconnecting to the server")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/xprtsock.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 02b071dbdd22..5fb969f8a5ad 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -2099,6 +2099,10 @@ static void xs_tcp_shutdown(struct rpc_xprt *xprt) if (sock == NULL) return; + if (!xprt->reuseport) { + xs_close(xprt); + return; + } switch (skst) { default: kernel_sock_shutdown(sock, SHUT_RDWR); |