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 408da2625dba..1f7eb2f67390 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -2110,17 +2110,21 @@ nfsd4_decode_copy_notify(struct nfsd4_compoundargs *argp, static __be32 nfsd4_decode_seek(struct nfsd4_compoundargs *argp, struct nfsd4_seek *seek) { - DECODE_HEAD; + __be32 status; status = nfsd4_decode_stateid4(argp, &seek->seek_stateid); if (status) - return status; - - READ_BUF(8 + 4); - p = xdr_decode_hyper(p, &seek->seek_offset); - seek->seek_whence = be32_to_cpup(p); + goto out; + if (xdr_stream_decode_u64(argp->xdr, &seek->seek_offset) < 0) + goto xdr_error; + if (xdr_stream_decode_u32(argp->xdr, &seek->seek_whence) < 0) + goto xdr_error; - DECODE_TAIL; + status = nfs_ok; +out: + return status; +xdr_error: + return nfserr_bad_xdr; } /*