Skip to content

Commit

Permalink
ecryptfs: fixed msync to flush data
Browse files Browse the repository at this point in the history
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+
  • Loading branch information
Paul Taysom authored and Tyler Hicks committed May 24, 2013
1 parent bb3ec6b commit c15cddd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ecryptfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ static int ecryptfs_release(struct inode *inode, struct file *file)
static int
ecryptfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{
filemap_write_and_wait(file->f_mapping);
return vfs_fsync(ecryptfs_file_to_lower(file), datasync);
}

Expand Down

0 comments on commit c15cddd

Please sign in to comment.