[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1298969484-16199-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
Date: Tue, 1 Mar 2011 14:21:21 +0530
From: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To: v9fs-developer@...ts.sourceforge.net
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Subject: [PATCH 3/6] 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@...ux.vnet.ibm.com>
---
fs/9p/vfs_inode.c | 4 ++++
fs/9p/vfs_inode_dotl.c | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 7c60011..e49c592 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -1002,6 +1002,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;
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index b14d740..327c578 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -462,6 +462,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;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists