Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx> --- fs/nfsd/nfs4xdr.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 94e96bf09cc1..9afdb83c5c23 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1948,17 +1948,21 @@ static __be32 nfsd4_decode_fallocate(struct nfsd4_compoundargs *argp, struct nfsd4_fallocate *fallocate) { - DECODE_HEAD; + __be32 status; status = nfsd4_decode_stateid4(argp, &fallocate->falloc_stateid); if (status) - return status; - - READ_BUF(16); - p = xdr_decode_hyper(p, &fallocate->falloc_offset); - xdr_decode_hyper(p, &fallocate->falloc_length); + goto out; + if (xdr_stream_decode_u64(argp->xdr, &fallocate->falloc_offset) < 0) + goto xdr_error; + if (xdr_stream_decode_u64(argp->xdr, &fallocate->falloc_length) < 0) + goto xdr_error; - DECODE_TAIL; + status = nfs_ok; +out: + return status; +xdr_error: + return nfserr_bad_xdr; } static __be32