Skip to content

Commit

Permalink
NFSD: Replace READ* macros that decode the fattr4 mode 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 c941a96 commit 1c8f0ad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,11 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
} else
*acl = NULL;
if (bmval[1] & FATTR4_WORD1_MODE) {
READ_BUF(4);
iattr->ia_mode = be32_to_cpup(p++);
u32 mode;

if (xdr_stream_decode_u32(argp->xdr, &mode) < 0)
return nfserr_bad_xdr;
iattr->ia_mode = mode;
iattr->ia_mode &= (S_IFMT | S_IALLUGO);
iattr->ia_valid |= ATTR_MODE;
}
Expand Down

0 comments on commit 1c8f0ad

Please sign in to comment.