NFSD: Replace READ* macros in nfsd4_decode_open()

[ Upstream commit 61e5e0b3ec713d1365008c8af3fe5fdd262e2a60 ]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Chuck Lever
2020-11-01 12:04:06 -05:00
committed by Greg Kroah-Hartman
parent 4507c23e42
commit f6eb911d79

View File

@@ -1124,7 +1124,7 @@ nfsd4_decode_open_claim4(struct nfsd4_compoundargs *argp,
static __be32 static __be32
nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open) nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
{ {
DECODE_HEAD; __be32 status;
u32 dummy; u32 dummy;
memset(open->op_bmval, 0, sizeof(open->op_bmval)); memset(open->op_bmval, 0, sizeof(open->op_bmval));
@@ -1132,28 +1132,24 @@ nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
open->op_openowner = NULL; open->op_openowner = NULL;
open->op_xdr_error = 0; open->op_xdr_error = 0;
/* seqid, share_access, share_deny, clientid, ownerlen */ if (xdr_stream_decode_u32(argp->xdr, &open->op_seqid) < 0)
READ_BUF(4); return nfserr_bad_xdr;
open->op_seqid = be32_to_cpup(p++); /* deleg_want is ignored */
/* decode, yet ignore deleg_when until supported */
status = nfsd4_decode_share_access(argp, &open->op_share_access, status = nfsd4_decode_share_access(argp, &open->op_share_access,
&open->op_deleg_want, &dummy); &open->op_deleg_want, &dummy);
if (status) if (status)
goto xdr_error; return status;
status = nfsd4_decode_share_deny(argp, &open->op_share_deny); status = nfsd4_decode_share_deny(argp, &open->op_share_deny);
if (status) if (status)
goto xdr_error; return status;
READ_BUF(sizeof(clientid_t)); status = nfsd4_decode_state_owner4(argp, &open->op_clientid,
COPYMEM(&open->op_clientid, sizeof(clientid_t)); &open->op_owner);
status = nfsd4_decode_opaque(argp, &open->op_owner);
if (status) if (status)
goto xdr_error; return status;
status = nfsd4_decode_openflag4(argp, open); status = nfsd4_decode_openflag4(argp, open);
if (status) if (status)
return status; return status;
status = nfsd4_decode_open_claim4(argp, open); return nfsd4_decode_open_claim4(argp, open);
DECODE_TAIL;
} }
static __be32 static __be32