diff options
author | J. Bruce Fields <bfields@redhat.com> | 2017-06-28 13:34:15 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2017-06-28 13:34:15 -0400 |
commit | 9a1d168e1bc2893120bb7c0d9932dd22f97d0b55 (patch) | |
tree | f7d419f1601419aa0aebda102a6b14bdf7653443 /fs/nfsd/nfs3xdr.c | |
parent | bb2a8b0cd116219777b99cb71fe9e24b31d3f521 (diff) | |
parent | 32c1431eea4881a6b17bd7c639315010aeefa452 (diff) |
Merge tag 'v4.12-rc5' into nfsd tree
Update to get f0c3192ceee3 "virtio_net: lower limit on buffer size".
That bug was interfering with my nfsd testing.
Diffstat (limited to 'fs/nfsd/nfs3xdr.c')
-rw-r--r-- | fs/nfsd/nfs3xdr.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index 349e355edc73..b8838d3023ff 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c @@ -339,11 +339,8 @@ nfs3svc_decode_readargs(struct svc_rqst *rqstp, __be32 *p) if (!p) return 0; p = xdr_decode_hyper(p, &args->offset); - args->count = ntohl(*p++); - - if (!xdr_argsize_check(rqstp, p)) - return 0; + args->count = ntohl(*p++); len = min(args->count, max_blocksize); /* set up the kvec */ @@ -357,7 +354,7 @@ nfs3svc_decode_readargs(struct svc_rqst *rqstp, __be32 *p) v++; } args->vlen = v; - return 1; + return xdr_argsize_check(rqstp, p); } int @@ -555,11 +552,9 @@ nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p) p = decode_fh(p, &args->fh); if (!p) return 0; - if (!xdr_argsize_check(rqstp, p)) - return 0; args->buffer = page_address(*(rqstp->rq_next_page++)); - return 1; + return xdr_argsize_check(rqstp, p); } int @@ -586,14 +581,10 @@ nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p) args->verf = p; p += 2; args->dircount = ~0; args->count = ntohl(*p++); - - if (!xdr_argsize_check(rqstp, p)) - return 0; - args->count = min_t(u32, args->count, PAGE_SIZE); args->buffer = page_address(*(rqstp->rq_next_page++)); - return 1; + return xdr_argsize_check(rqstp, p); } int @@ -611,9 +602,6 @@ nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p) args->dircount = ntohl(*p++); args->count = ntohl(*p++); - if (!xdr_argsize_check(rqstp, p)) - return 0; - len = args->count = min(args->count, max_blocksize); while (len > 0) { struct page *p = *(rqstp->rq_next_page++); @@ -621,7 +609,8 @@ nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p) args->buffer = page_address(p); len -= PAGE_SIZE; } - return 1; + + return xdr_argsize_check(rqstp, p); } int |