SUNRPC: Ensure xs_tcp_shutdown() requests a full close of the connection
authorTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 9 Feb 2015 14:26:39 +0000 (09:26 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 9 Feb 2015 14:31:11 +0000 (09:31 -0500)
The previous behaviour left the connection half-open in order to try
to scrape the last replies from the socket. Now that we have more reliable
reconnection, change the behaviour to close down the socket faster.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
net/sunrpc/xprtsock.c

index 2f8db3499a172fb03c9c3b77de2955da97de1bb7..3d83cbd32ef250439fc54a43df2cae98ddd9025c 100644 (file)
@@ -627,7 +627,7 @@ process_status:
  * @xprt: transport
  *
  * Initiates a graceful shutdown of the TCP socket by calling the
- * equivalent of shutdown(SHUT_WR);
+ * equivalent of shutdown(SHUT_RDWR);
  */
 static void xs_tcp_shutdown(struct rpc_xprt *xprt)
 {
@@ -635,7 +635,7 @@ static void xs_tcp_shutdown(struct rpc_xprt *xprt)
        struct socket *sock = transport->sock;
 
        if (sock != NULL) {
-               kernel_sock_shutdown(sock, SHUT_WR);
+               kernel_sock_shutdown(sock, SHUT_RDWR);
                trace_rpc_socket_shutdown(xprt, sock);
        }
 }