aboutsummaryrefslogtreecommitdiff
path: root/fs/nfs/inode.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-21 21:04:16 +0200
committerAdrian Bunk <bunk@kernel.org>2008-01-21 21:04:16 +0200
commit1ab450b035f18aca5bb219ba3de45ca04e2df2b9 (patch)
treef87969db81cf2c421fe7116a340488b921a6ccbf /fs/nfs/inode.c
parent83005c1cb725c489abba78e08908d76bb248ef82 (diff)
NFS: call nfs_wb_all() only on regular files
It looks like nfs_setattr() and nfs_rename() also need to test whether the target is a regular file before calling nfs_wb_all()... It isn't technically needed since the version of nfs_wb_all() that exists on 2.6.16 should be safe to call on non-regular files (it will be a no-op). However it is a useful optimisation. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r--fs/nfs/inode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 0524a20be3f..8bcba4979e4 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -860,8 +860,10 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr)
lock_kernel();
nfs_begin_data_update(inode);
/* Write all dirty data */
- filemap_write_and_wait(inode->i_mapping);
- nfs_wb_all(inode);
+ if (S_ISREG(inode->i_mode)) {
+ filemap_write_and_wait(inode->i_mapping);
+ nfs_wb_all(inode);
+ }
/*
* Return any delegations if we're going to change ACLs
*/