[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1369344703-22245-1-git-send-email-taysom@chromium.org>
Date: Thu, 23 May 2013 14:31:43 -0700
From: Paul Taysom <taysom@...omium.org>
To: Tyler Hicks <tyhicks@...onical.com>
Cc: Dustin Kirkland <dustin.kirkland@...zang.com>,
ecryptfs@...r.kernel.org, linux-kernel@...r.kernel.org,
olofj@...omium.org, taysom@...omium.org
Subject: [PATCH] fs: 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@...omium.org>
---
fs/ecryptfs/file.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 201f0a0..16f509d 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)
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.2.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