Commit 66f0476c authored by Chuck Lever's avatar Chuck Lever

NFSD: Replace READ* macros that decode the fattr4 umask attribute

Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent dabe9182
...@@ -358,7 +358,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, ...@@ -358,7 +358,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
{ {
unsigned int starting_pos; unsigned int starting_pos;
u32 attrlist4_count; u32 attrlist4_count;
u32 dummy32;
DECODE_HEAD; DECODE_HEAD;
iattr->ia_valid = 0; iattr->ia_valid = 0;
...@@ -474,13 +473,16 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, ...@@ -474,13 +473,16 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
return status; return status;
} }
if (bmval[2] & FATTR4_WORD2_MODE_UMASK) { if (bmval[2] & FATTR4_WORD2_MODE_UMASK) {
u32 mode, mask;
if (!umask) if (!umask)
goto xdr_error; return nfserr_bad_xdr;
READ_BUF(8); if (xdr_stream_decode_u32(argp->xdr, &mode) < 0)
dummy32 = be32_to_cpup(p++); return nfserr_bad_xdr;
iattr->ia_mode = dummy32 & (S_IFMT | S_IALLUGO); iattr->ia_mode = mode & (S_IFMT | S_IALLUGO);
dummy32 = be32_to_cpup(p++); if (xdr_stream_decode_u32(argp->xdr, &mask) < 0)
*umask = dummy32 & S_IRWXUGO; return nfserr_bad_xdr;
*umask = mask & S_IRWXUGO;
iattr->ia_valid |= ATTR_MODE; iattr->ia_valid |= ATTR_MODE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment