diff options
author | Trond Myklebust | 2019-02-16 09:31:47 -0500 |
---|---|---|
committer | Trond Myklebust | 2019-02-20 17:35:58 -0500 |
commit | 5f52a9d429b8ba8f9d669730adf16bc534eb74ea (patch) | |
tree | 30aad853a825e04cb4700f1ddfd39e959bec0de9 /net/sunrpc | |
parent | 727fcc64a0f8d346bdd60a7c92e9e720228ce037 (diff) |
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.c | 5 |
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); |