aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/inode.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-06-10 19:39:41 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-07-09 12:09:14 -0400
commit659bfcd6dd88919a5ad453f62afbeffcb3106847 (patch)
treee3996d809e9ae4860a8adac71474e6ea8850c3b5 /fs/nfs/inode.c
parenta486aeda9b2b0d944aecce7871b3186379b898de (diff)
NFS: Fix the ftruncate() credential problem
ftruncate() access checking is supposed to be performed at open() time, just like reads and writes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r--fs/nfs/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 596c5d8e86f4..2e4ab4a5e107 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -347,7 +347,7 @@ out_no_inode:
347 goto out; 347 goto out;
348} 348}
349 349
350#define NFS_VALID_ATTRS (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE|ATTR_ATIME|ATTR_ATIME_SET|ATTR_MTIME|ATTR_MTIME_SET) 350#define NFS_VALID_ATTRS (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE|ATTR_ATIME|ATTR_ATIME_SET|ATTR_MTIME|ATTR_MTIME_SET|ATTR_FILE)
351 351
352int 352int
353nfs_setattr(struct dentry *dentry, struct iattr *attr) 353nfs_setattr(struct dentry *dentry, struct iattr *attr)
@@ -369,7 +369,7 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr)
369 369
370 /* Optimization: if the end result is no change, don't RPC */ 370 /* Optimization: if the end result is no change, don't RPC */
371 attr->ia_valid &= NFS_VALID_ATTRS; 371 attr->ia_valid &= NFS_VALID_ATTRS;
372 if (attr->ia_valid == 0) 372 if ((attr->ia_valid & ~ATTR_FILE) == 0)
373 return 0; 373 return 0;
374 374
375 lock_kernel(); 375 lock_kernel();