提交 c15cddd9 编写于 作者: P Paul Taysom 提交者: Tyler Hicks

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/239536Signed-off-by: NPaul Taysom <taysom@chromium.org>
Signed-off-by: NTyler Hicks <tyhicks@canonical.com>
Cc: stable@vger.kernel.org # v3.6+
上级 bb3ec6b0
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部