Skip to content

Commit

Permalink
SUNRPC: Treat EFAULT as a truncated message in xs_read_stream_request()
Browse files Browse the repository at this point in the history
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
Trond Myklebust committed Dec 5, 2018
1 parent 16e5e90 commit 26781ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ xs_read_xdr_buf(struct socket *sock, struct msghdr *msg, int flags,
} else
offset += buf->tail[0].iov_len;
ret = -EMSGSIZE;
msg->msg_flags |= MSG_TRUNC;
out:
*read = offset - seek_init;
return ret;
Expand Down Expand Up @@ -489,7 +488,9 @@ xs_read_stream_request(struct sock_xprt *transport, struct msghdr *msg,
switch (ret) {
default:
break;
case -EFAULT:
case -EMSGSIZE:
msg->msg_flags |= MSG_TRUNC;
return read;
case 0:
return -ESHUTDOWN;
Expand Down

0 comments on commit 26781ea

Please sign in to comment.