diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2020-11-03 14:44:28 -0500 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2020-11-30 14:46:40 -0500 |
commit | 244e2befcba80f42c65293b6c56282bb78f9f417 (patch) | |
tree | f77ac4dc9025e4a8add6c97f46958c0758670033 /fs/nfsd | |
parent | 67cd453eeda86be90f83a0f4798f33832cf2d98c (diff) | |
download | linux-stable-244e2befcba80f42c65293b6c56282bb78f9f417.tar.gz linux-stable-244e2befcba80f42c65293b6c56282bb78f9f417.tar.bz2 linux-stable-244e2befcba80f42c65293b6c56282bb78f9f417.zip |
NFSD: Replace READ* macros in nfsd4_decode_write()
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 4ec08eb48e33..8e960cdc351d 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1396,22 +1396,23 @@ nfsd4_decode_verify(struct nfsd4_compoundargs *argp, struct nfsd4_verify *verify static __be32 nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write) { - DECODE_HEAD; + __be32 status; - status = nfsd4_decode_stateid(argp, &write->wr_stateid); + status = nfsd4_decode_stateid4(argp, &write->wr_stateid); if (status) return status; - READ_BUF(16); - p = xdr_decode_hyper(p, &write->wr_offset); - write->wr_stable_how = be32_to_cpup(p++); + if (xdr_stream_decode_u64(argp->xdr, &write->wr_offset) < 0) + return nfserr_bad_xdr; + if (xdr_stream_decode_u32(argp->xdr, &write->wr_stable_how) < 0) + return nfserr_bad_xdr; if (write->wr_stable_how > NFS_FILE_SYNC) - goto xdr_error; - write->wr_buflen = be32_to_cpup(p++); - + return nfserr_bad_xdr; + if (xdr_stream_decode_u32(argp->xdr, &write->wr_buflen) < 0) + return nfserr_bad_xdr; if (!xdr_stream_subsegment(argp->xdr, &write->wr_payload, write->wr_buflen)) - goto xdr_error; + return nfserr_bad_xdr; - DECODE_TAIL; + return nfs_ok; } static __be32 |