SUNRPC: Don't suppress socket errors when a message read completes
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 15 Feb 2019 21:53:04 +0000 (16:53 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 20 Feb 2019 22:35:58 +0000 (17:35 -0500)
If the message read completes, but the socket returned an error
condition, we should ensure to propagate that error.

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

index 492cec3f1451b31b4fdcbe6303b888463468379e..e51716e888994c100f266205e8a23040d782ba68 100644 (file)
@@ -508,13 +508,10 @@ xs_read_stream_request(struct sock_xprt *transport, struct msghdr *msg,
                                &read);
                transport->recv.offset += read;
                transport->recv.copied += read;
-       } else
-               read = 0;
+       }
 
-       if (transport->recv.offset == transport->recv.len) {
+       if (transport->recv.offset == transport->recv.len)
                xs_read_stream_check_eor(transport, msg);
-               return read;
-       }
 
        if (want == 0)
                return 0;