]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
SUNRPC: Initiate a connection close on an ESHUTDOWN error in stream receive
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 16 Feb 2019 14:31:47 +0000 (09:31 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 20 Feb 2019 22:35:58 +0000 (17:35 -0500)
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>
net/sunrpc/xprtsock.c

index e51716e888994c100f266205e8a23040d782ba68..a3aadc04808fb0c842754d5648b598a6df15e67e 100644 (file)
@@ -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);