summaryrefslogtreecommitdiff
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-02-16 17:31:47 +0300
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-02-21 01:35:58 +0300
commit5f52a9d429b8ba8f9d669730adf16bc534eb74ea (patch)
tree30aad853a825e04cb4700f1ddfd39e959bec0de9 /net/sunrpc
parent727fcc64a0f8d346bdd60a7c92e9e720228ce037 (diff)
downloadlinux-5f52a9d429b8ba8f9d669730adf16bc534eb74ea.tar.xz
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 <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtsock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index e51716e88899..a3aadc04808f 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);