[ 3.8.y.z extended stable ] Patch "ecryptfs: fixed msync to flush data" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Mon Jun 10 22:04:32 UTC 2013


This is a note to let you know that I have just added a patch titled

    ecryptfs: fixed msync to flush data

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue

This patch is scheduled to be released in version 3.8.13.3.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 0399ebfd37c6292251edbc7ff245317c33eb857a Mon Sep 17 00:00:00 2001
From: Paul Taysom <taysom at chromium.org>
Date: Thu, 23 May 2013 14:31:43 -0700
Subject: ecryptfs: fixed msync to flush data

commit c15cddd900e867c5adfb3c79596479dc5975f743 upstream.

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 at chromium.org>
Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 fs/ecryptfs/file.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index d45ba45..4f9a25e 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -296,6 +296,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);
 }

--
1.8.1.2





More information about the kernel-team mailing list