Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756779Ab3FKUEM (ORCPT ); Tue, 11 Jun 2013 16:04:12 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41981 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756717Ab3FKUEF (ORCPT ); Tue, 11 Jun 2013 16:04:05 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Taysom , Tyler Hicks Subject: [ 50/79] ecryptfs: fixed msync to flush data Date: Tue, 11 Jun 2013 13:03:16 -0700 Message-Id: <20130611195322.669669204@linuxfoundation.org> X-Mailer: git-send-email 1.8.3.254.g5578ad7 In-Reply-To: <20130611195312.352656079@linuxfoundation.org> References: <20130611195312.352656079@linuxfoundation.org> User-Agent: quilt/0.60-5.1.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1340 Lines: 43 3.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Taysom 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 Signed-off-by: Tyler Hicks Signed-off-by: Greg Kroah-Hartman --- fs/ecryptfs/file.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c @@ -294,6 +294,7 @@ static int ecryptfs_release(struct inode 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); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/