aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPaul Taysom <taysom@chromium.org>2013-05-23 17:31:43 -0400
committerTyler Hicks <tyhicks@canonical.com>2013-05-24 19:21:45 -0400
commitc15cddd900e867c5adfb3c79596479dc5975f743 (patch)
treebc9607f2d1c40850da4c247d842dd1275c1785b5 /fs
parentbb3ec6b08396bbd631b6441102dd1c3d89cbc576 (diff)
ecryptfs: fixed msync to flush data
When msync is called on a memory mapped file, that data is not flushed to the disk. In Linux, msync calls fsync for the file. For ecryptfs, fsync just calls the lower level file system's fsync. Changed the ecryptfs fsync code to call filemap_write_and_wait before calling the lower level fsync. Addresses the problem described in http://crbug.com/239536 Signed-off-by: Paul Taysom <taysom@chromium.org> Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Cc: stable@vger.kernel.org # v3.6+
Diffstat (limited to 'fs')
-rw-r--r--fs/ecryptfs/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 201f0a0d6b0a..16f509d6fa49 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -295,6 +295,7 @@ static int ecryptfs_release(struct inode *inode, struct file *file)
295static int 295static int
296ecryptfs_fsync(struct file *file, loff_t start, loff_t end, int datasync) 296ecryptfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
297{ 297{
298 filemap_write_and_wait(file->f_mapping);
298 return vfs_fsync(ecryptfs_file_to_lower(file), datasync); 299 return vfs_fsync(ecryptfs_file_to_lower(file), datasync);
299} 300}
300 301