From 3dc5436aa5719be029bbc2bef0e5cb0312e4ff88 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Mon, 28 Feb 2011 17:04:11 +0530 Subject: 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 Signed-off-by: Venkateswararao Jujjuri Signed-off-by: Eric Van Hensbergen --- fs/9p/vfs_inode_dotl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/9p/vfs_inode_dotl.c') diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index bcd0ee2e549..67c138e94fe 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -459,6 +459,10 @@ int v9fs_vfs_setattr_dotl(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_setattr(fid, &p9attr); if (retval < 0) return retval; -- cgit v1.2.3