diff options
author | Benny Halevy <bhalevy@panasas.com> | 2009-04-03 01:29:05 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-04-03 20:41:22 -0400 |
commit | c0d6fc8a2d55a8235c301aeb6d5254d5992895d1 (patch) | |
tree | 6823f69f411cf37cebf65d1862f4fa9071c40597 /fs/nfsd/nfs4xdr.c | |
parent | f3ec22b5b0b4b220ee600bf1a8b6dc045b4e72bd (diff) |
nfsd41: pass writable attrs mask to nfsd4_decode_fattr
In preparation for EXCLUSIVE4_1
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 059d4aad39b8..42f9fb661006 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -251,9 +251,14 @@ nfsd4_decode_bitmap(struct nfsd4_compoundargs *argp, u32 *bmval) | |||
251 | DECODE_TAIL; | 251 | DECODE_TAIL; |
252 | } | 252 | } |
253 | 253 | ||
254 | static u32 nfsd_attrmask[] = { | ||
255 | NFSD_WRITEABLE_ATTRS_WORD0, | ||
256 | NFSD_WRITEABLE_ATTRS_WORD1 | ||
257 | }; | ||
258 | |||
254 | static __be32 | 259 | static __be32 |
255 | nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, struct iattr *iattr, | 260 | nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, u32 *writable, |
256 | struct nfs4_acl **acl) | 261 | struct iattr *iattr, struct nfs4_acl **acl) |
257 | { | 262 | { |
258 | int expected_len, len = 0; | 263 | int expected_len, len = 0; |
259 | u32 dummy32; | 264 | u32 dummy32; |
@@ -271,7 +276,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, struct iattr *ia | |||
271 | */ | 276 | */ |
272 | if ((bmval[0] & ~NFSD_SUPPORTED_ATTRS_WORD0) || (bmval[1] & ~NFSD_SUPPORTED_ATTRS_WORD1)) | 277 | if ((bmval[0] & ~NFSD_SUPPORTED_ATTRS_WORD0) || (bmval[1] & ~NFSD_SUPPORTED_ATTRS_WORD1)) |
273 | return nfserr_attrnotsupp; | 278 | return nfserr_attrnotsupp; |
274 | if ((bmval[0] & ~NFSD_WRITEABLE_ATTRS_WORD0) || (bmval[1] & ~NFSD_WRITEABLE_ATTRS_WORD1)) | 279 | if ((bmval[0] & ~writable[0]) || (bmval[1] & ~writable[1])) |
275 | return nfserr_inval; | 280 | return nfserr_inval; |
276 | 281 | ||
277 | READ_BUF(4); | 282 | READ_BUF(4); |
@@ -499,7 +504,9 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create | |||
499 | if ((status = check_filename(create->cr_name, create->cr_namelen, nfserr_inval))) | 504 | if ((status = check_filename(create->cr_name, create->cr_namelen, nfserr_inval))) |
500 | return status; | 505 | return status; |
501 | 506 | ||
502 | if ((status = nfsd4_decode_fattr(argp, create->cr_bmval, &create->cr_iattr, &create->cr_acl))) | 507 | status = nfsd4_decode_fattr(argp, create->cr_bmval, nfsd_attrmask, |
508 | &create->cr_iattr, &create->cr_acl); | ||
509 | if (status) | ||
503 | goto out; | 510 | goto out; |
504 | 511 | ||
505 | DECODE_TAIL; | 512 | DECODE_TAIL; |
@@ -660,7 +667,9 @@ nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open) | |||
660 | switch (open->op_createmode) { | 667 | switch (open->op_createmode) { |
661 | case NFS4_CREATE_UNCHECKED: | 668 | case NFS4_CREATE_UNCHECKED: |
662 | case NFS4_CREATE_GUARDED: | 669 | case NFS4_CREATE_GUARDED: |
663 | if ((status = nfsd4_decode_fattr(argp, open->op_bmval, &open->op_iattr, &open->op_acl))) | 670 | status = nfsd4_decode_fattr(argp, open->op_bmval, |
671 | nfsd_attrmask, &open->op_iattr, &open->op_acl); | ||
672 | if (status) | ||
664 | goto out; | 673 | goto out; |
665 | break; | 674 | break; |
666 | case NFS4_CREATE_EXCLUSIVE: | 675 | case NFS4_CREATE_EXCLUSIVE: |
@@ -859,7 +868,7 @@ nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, struct nfsd4_setattr *seta | |||
859 | status = nfsd4_decode_stateid(argp, &setattr->sa_stateid); | 868 | status = nfsd4_decode_stateid(argp, &setattr->sa_stateid); |
860 | if (status) | 869 | if (status) |
861 | return status; | 870 | return status; |
862 | return nfsd4_decode_fattr(argp, setattr->sa_bmval, | 871 | return nfsd4_decode_fattr(argp, setattr->sa_bmval, nfsd_attrmask, |
863 | &setattr->sa_iattr, &setattr->sa_acl); | 872 | &setattr->sa_iattr, &setattr->sa_acl); |
864 | } | 873 | } |
865 | 874 | ||