[1/3] SUNRPC: Don't suppress socket errors when a message read completes
diff mbox series

Message ID 20190219162202.68013-1-trond.myklebust@hammerspace.com
State New
Headers show
Series
  • [1/3] SUNRPC: Don't suppress socket errors when a message read completes
Related show

Commit Message

Trond Myklebust Feb. 19, 2019, 4:22 p.m. UTC
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 | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Patch
diff mbox series

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index d663f75a6536..52c98dc480ec 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -498,11 +498,9 @@  xs_read_stream_request(struct sock_xprt *transport, struct msghdr *msg,
 			&read);
 	transport->recv.offset += read;
 	transport->recv.copied += read;
-	if (transport->recv.offset == transport->recv.len) {
-		if (xs_read_stream_request_done(transport))
-			msg->msg_flags |= MSG_EOR;
-		return read;
-	}
+	if (transport->recv.offset == transport->recv.len &&
+	    xs_read_stream_request_done(transport))
+		msg->msg_flags |= MSG_EOR;
 
 	switch (ret) {
 	default: