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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
---
 net/sunrpc/xprtsock.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

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:
-- 
2.20.1




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux