summaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_inode.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-02-28 17:04:11 +0530
committerEric Van Hensbergen <ericvh@gmail.com>2011-03-15 09:57:42 -0500
commit3dc5436aa5719be029bbc2bef0e5cb0312e4ff88 (patch)
treedf64706ba7b9e8d1b837b77c8f0d7ddefaf5f78e /fs/9p/vfs_inode.c
parentf10fc50f1adaf40fdd5da6dd154ecb464b468e2f (diff)
downloadlinux-stable-3dc5436aa5719be029bbc2bef0e5cb0312e4ff88.tar.gz
linux-stable-3dc5436aa5719be029bbc2bef0e5cb0312e4ff88.tar.bz2
linux-stable-3dc5436aa5719be029bbc2bef0e5cb0312e4ff88.zip
fs/9p: Writeback dirty data before setattr
change file attribute can result in making the file readonly. So flush the dirty pages before that. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p/vfs_inode.c')
-rw-r--r--fs/9p/vfs_inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 2555776920ad..8a2c232f708a 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -999,6 +999,10 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr)
if (retval)
return retval;
}
+ /* Write all dirty data */
+ if (S_ISREG(dentry->d_inode->i_mode))
+ filemap_write_and_wait(dentry->d_inode->i_mapping);
+
retval = p9_client_wstat(fid, &wstat);
if (retval < 0)
return retval;