summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2018-12-03 15:41:38 -0500
committerTrond Myklebust <trond.myklebust@hammerspace.com>2018-12-05 07:11:12 -0500
commit26781eab48ece79000ffc4e69be402f2524e1137 (patch)
treeed14c68ef0942d7d2ea0463e018508c5ead9b6b9 /net
parent16e5e90f0e4f9b7b2e4d08558a2f695e2fa1fb0d (diff)
downloadlinux-26781eab48ece79000ffc4e69be402f2524e1137.tar.bz2
SUNRPC: Treat EFAULT as a truncated message in xs_read_stream_request()
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/xprtsock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index cd85c492c267..86bb502e538a 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -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;
@@ -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;