Skip to content

Commit caf4ccd

Browse files
committed
SUNRPC: Make xs_tcp_close() do a socket shutdown rather than a sock_release
Use of socket shutdown() means that we monitor the shutdown process through the xs_tcp_state_change() callback, so it is preferable to a full close in all cases unless we're destroying the transport. Signed-off-by: Trond Myklebust <[email protected]>
1 parent 0efeac2 commit caf4ccd

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

net/sunrpc/xprtsock.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -857,10 +857,7 @@ static void xs_close(struct rpc_xprt *xprt)
857857

858858
static void xs_tcp_close(struct rpc_xprt *xprt)
859859
{
860-
if (test_and_clear_bit(XPRT_CONNECTION_CLOSE, &xprt->state))
861-
xs_close(xprt);
862-
else
863-
xs_tcp_shutdown(xprt);
860+
xs_tcp_shutdown(xprt);
864861
}
865862

866863
static void xs_xprt_free(struct rpc_xprt *xprt)
@@ -1033,7 +1030,6 @@ static void xs_udp_data_ready(struct sock *sk)
10331030
*/
10341031
static void xs_tcp_force_close(struct rpc_xprt *xprt)
10351032
{
1036-
set_bit(XPRT_CONNECTION_CLOSE, &xprt->state);
10371033
xprt_force_disconnect(xprt);
10381034
}
10391035

0 commit comments

Comments
 (0)