]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
SUNRPC: Treat EFAULT as a truncated message in xs_read_stream_request()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 3 Dec 2018 20:41:38 +0000 (15:41 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 5 Dec 2018 12:11:12 +0000 (07:11 -0500)
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/xprtsock.c

index cd85c492c267b3a827729ffd13687195843d5fc1..86bb502e538a2c25b3f55be99d7d8570d07eb8a8 100644 (file)
@@ -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;