]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
nfsd: don't allow setting ctime over v4
authorJ. Bruce Fields <bfields@citi.umich.edu>
Thu, 24 Apr 2008 20:59:30 +0000 (16:59 -0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Fri, 25 Apr 2008 17:00:11 +0000 (13:00 -0400)
Presumably this is left over from earlier drafts of v4, which listed
TIME_METADATA as writeable.  It's read-only in rfc 3530, and shouldn't
be modifiable anyway.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfs4xdr.c
include/linux/nfsd/nfsd.h

index 1ba7ad981935d6f455d5c3185c78ba0842913898..c513bbdf2d36a2188d286ae1e32cbb81fab16107 100644 (file)
@@ -376,20 +376,6 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, struct iattr *ia
                        goto xdr_error;
                }
        }
-       if (bmval[1] & FATTR4_WORD1_TIME_METADATA) {
-               /* We require the high 32 bits of 'seconds' to be 0, and we ignore
-                  all 32 bits of 'nseconds'. */
-               READ_BUF(12);
-               len += 12;
-               READ32(dummy32);
-               if (dummy32)
-                       return nfserr_inval;
-               READ32(iattr->ia_ctime.tv_sec);
-               READ32(iattr->ia_ctime.tv_nsec);
-               if (iattr->ia_ctime.tv_nsec >= (u32)1000000000)
-                       return nfserr_inval;
-               iattr->ia_valid |= ATTR_CTIME;
-       }
        if (bmval[1] & FATTR4_WORD1_TIME_MODIFY_SET) {
                READ_BUF(4);
                len += 4;
index 21ee440dd3e768eb2bbb1e72f3a33d54c31b69da..41d30c9c9de6e4b33045d232239f0366d2349916 100644 (file)
@@ -329,7 +329,7 @@ extern struct timeval       nfssvc_boot;
 (FATTR4_WORD0_SIZE              | FATTR4_WORD0_ACL                                         )
 #define NFSD_WRITEABLE_ATTRS_WORD1                                                          \
 (FATTR4_WORD1_MODE              | FATTR4_WORD1_OWNER         | FATTR4_WORD1_OWNER_GROUP     \
- | FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_METADATA | FATTR4_WORD1_TIME_MODIFY_SET)
+ | FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET)
 
 #endif /* CONFIG_NFSD_V4 */