Skip to content

Commit 2212036

Browse files
committed
NFSD: Replace READ* macros in nfsd4_decode_listxattrs()
Signed-off-by: Chuck Lever <[email protected]>
1 parent 403366a commit 2212036

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fs/nfsd/nfs4xdr.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2223,11 +2223,10 @@ static __be32
22232223
nfsd4_decode_listxattrs(struct nfsd4_compoundargs *argp,
22242224
struct nfsd4_listxattrs *listxattrs)
22252225
{
2226-
DECODE_HEAD;
22272226
u32 maxcount;
22282227

2229-
READ_BUF(12);
2230-
p = xdr_decode_hyper(p, &listxattrs->lsxa_cookie);
2228+
if (xdr_stream_decode_u64(argp->xdr, &listxattrs->lsxa_cookie) < 0)
2229+
return nfserr_bad_xdr;
22312230

22322231
/*
22332232
* If the cookie is too large to have even one user.x attribute
@@ -2237,15 +2236,16 @@ nfsd4_decode_listxattrs(struct nfsd4_compoundargs *argp,
22372236
(XATTR_LIST_MAX / (XATTR_USER_PREFIX_LEN + 2)))
22382237
return nfserr_badcookie;
22392238

2240-
maxcount = be32_to_cpup(p++);
2239+
if (xdr_stream_decode_u32(argp->xdr, &maxcount) < 0)
2240+
return nfserr_bad_xdr;
22412241
if (maxcount < 8)
22422242
/* Always need at least 2 words (length and one character) */
22432243
return nfserr_inval;
22442244

22452245
maxcount = min(maxcount, svc_max_payload(argp->rqstp));
22462246
listxattrs->lsxa_maxcount = maxcount;
22472247

2248-
DECODE_TAIL;
2248+
return nfs_ok;
22492249
}
22502250

22512251
static __be32

0 commit comments

Comments
 (0)