summaryrefslogtreecommitdiffstats
path: root/fs/nfs/inode.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-04-14 19:07:28 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-14 21:46:47 -0700
commite1552e199857109d4b25b9163eff4646726eee3d (patch)
tree344af8502076a414c7b579bc33e0c98f21a20b2c /fs/nfs/inode.c
parentc9c57929d23e44f258d1b6e7f089e72c85f0bd1c (diff)
downloadlinux-e1552e199857109d4b25b9163eff4646726eee3d.tar.gz
linux-e1552e199857109d4b25b9163eff4646726eee3d.tar.bz2
linux-e1552e199857109d4b25b9163eff4646726eee3d.zip
NFS: Fix an Oops in nfs_setattr()
It looks like nfs_setattr() and nfs_rename() also need to test whether the target is a regular file before calling nfs_wb_all()... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.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 93d046c85f52..44aa9b726573 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -341,8 +341,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
*/