]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
SUNRPC: Don't force a redundant disconnection in xs_read_stream()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 3 Dec 2018 23:49:00 +0000 (18:49 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 5 Dec 2018 12:11:12 +0000 (07:11 -0500)
If the connection is broken, then xs_tcp_state_change() will take care
of scheduling the socket close as soon as appropriate. xs_read_stream()
just needs to report the error.

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

index 92d08be2384d215ba8a2309e6c55907742943fa0..8a5e823e0b339b1998ff21b9cac814de213a2b23 100644 (file)
@@ -634,13 +634,7 @@ xs_read_stream(struct sock_xprt *transport, int flags)
        transport->recv.len = 0;
        return read;
 out_err:
-       switch (ret) {
-       case 0:
-       case -ESHUTDOWN:
-               xprt_force_disconnect(&transport->xprt);
-               return -ESHUTDOWN;
-       }
-       return ret;
+       return ret != 0 ? ret : -ESHUTDOWN;
 }
 
 static void xs_stream_data_receive(struct sock_xprt *transport)