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)
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,
437 } else 437 } else
438 offset += buf->tail[0].iov_len; 438 offset += buf->tail[0].iov_len;
439 ret = -EMSGSIZE; 439 ret = -EMSGSIZE;
440 msg->msg_flags |= MSG_TRUNC;
441out: 440out:
442 *read = offset - seek_init; 441 *read = offset - seek_init;
443 return ret; 442 return ret;
@@ -489,7 +488,9 @@ xs_read_stream_request(struct sock_xprt *transport, struct msghdr *msg,
489 switch (ret) { 488 switch (ret) {
490 default: 489 default:
491 break; 490 break;
491 case -EFAULT:
492 case -EMSGSIZE: 492 case -EMSGSIZE:
493 msg->msg_flags |= MSG_TRUNC;
493 return read; 494 return read;
494 case 0: 495 case 0:
495 return -ESHUTDOWN; 496 return -ESHUTDOWN;