提交 0a6ff58e 编写于 作者: T Trond Myklebust 提交者: Anna Schumaker

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: e6237b6f ("NFSv4.1: Don't rebind to the same source port when reconnecting to the server")
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
上级 ca7d1d1a
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册