Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx> --- fs/nfsd/nfs4xdr.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index b4f23d1fd85e..c7e7854b5e19 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1121,21 +1121,26 @@ nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_open_con static __be32 nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp, struct nfsd4_open_downgrade *open_down) { - DECODE_HEAD; - + __be32 status; + status = nfsd4_decode_stateid4(argp, &open_down->od_stateid); if (status) - return status; - READ_BUF(4); - open_down->od_seqid = be32_to_cpup(p++); + goto out; + if (xdr_stream_decode_u32(argp->xdr, &open_down->od_seqid) < 0) + goto xdr_error; status = nfsd4_decode_share_access(argp, &open_down->od_share_access, &open_down->od_deleg_want, NULL); if (status) - return status; + goto out; status = nfsd4_decode_share_deny(argp, &open_down->od_share_deny); if (status) - return status; - DECODE_TAIL; + goto out; + + status = nfs_ok; +out: + return status; +xdr_error: + return nfserr_bad_xdr; } static __be32