Commit 26781eab authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Treat EFAULT as a truncated message in xs_read_stream_request()

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 16e5e90f
...@@ -437,7 +437,6 @@ xs_read_xdr_buf(struct socket *sock, struct msghdr *msg, int flags, ...@@ -437,7 +437,6 @@ xs_read_xdr_buf(struct socket *sock, struct msghdr *msg, int flags,
} else } else
offset += buf->tail[0].iov_len; offset += buf->tail[0].iov_len;
ret = -EMSGSIZE; ret = -EMSGSIZE;
msg->msg_flags |= MSG_TRUNC;
out: out:
*read = offset - seek_init; *read = offset - seek_init;
return ret; return ret;
...@@ -489,7 +488,9 @@ xs_read_stream_request(struct sock_xprt *transport, struct msghdr *msg, ...@@ -489,7 +488,9 @@ xs_read_stream_request(struct sock_xprt *transport, struct msghdr *msg,
switch (ret) { switch (ret) {
default: default:
break; break;
case -EFAULT:
case -EMSGSIZE: case -EMSGSIZE:
msg->msg_flags |= MSG_TRUNC;
return read; return read;
case 0: case 0:
return -ESHUTDOWN; return -ESHUTDOWN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment