From: Trond Myklebust Date: Sat, 16 Feb 2019 14:31:47 +0000 (-0500) Subject: SUNRPC: Initiate a connection close on an ESHUTDOWN error in stream receive X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5f52a9d429b8ba8f9d669730adf16bc534eb74ea;p=linux.git SUNRPC: Initiate a connection close on an ESHUTDOWN error in stream receive If the client stream receive code receives an ESHUTDOWN error either because the server closed the connection, or because it sent a callback which cannot be processed, then we should shut down the connection. Signed-off-by: Trond Myklebust --- diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index e51716e888994..a3aadc04808fb 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -705,7 +705,10 @@ static void xs_stream_data_receive(struct sock_xprt *transport) read += ret; cond_resched(); } - xs_poll_check_readable(transport); + if (ret == -ESHUTDOWN) + kernel_sock_shutdown(transport->sock, SHUT_RDWR); + else + xs_poll_check_readable(transport); out: mutex_unlock(&transport->recv_mutex); trace_xs_stream_read_data(&transport->xprt, ret, read);