Skip to content

Commit

Permalink
SUNRPC: Don't suppress socket errors when a message read completes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust committed Feb 20, 2019
1 parent e92053a commit 727fcc6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 727fcc6

Please sign in to comment.