Skip to content

Commit

Permalink
NFSD: Replace READ* macros that decode the fattr4 owner_group attribute
Browse files Browse the repository at this point in the history
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
Chuck Lever committed Nov 30, 2020
1 parent 9853a5a commit 393c31d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,16 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
iattr->ia_valid |= ATTR_UID;
}
if (bmval[1] & FATTR4_WORD1_OWNER_GROUP) {
READ_BUF(4);
dummy32 = be32_to_cpup(p++);
READ_BUF(dummy32);
READMEM(buf, dummy32);
if ((status = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid)))
u32 length;

if (xdr_stream_decode_u32(argp->xdr, &length) < 0)
return nfserr_bad_xdr;
p = xdr_inline_decode(argp->xdr, length);
if (!p)
return nfserr_bad_xdr;
status = nfsd_map_name_to_gid(argp->rqstp, (char *)p, length,
&iattr->ia_gid);
if (status)
return status;
iattr->ia_valid |= ATTR_GID;
}
Expand Down

0 comments on commit 393c31d

Please sign in to comment.