summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-06-08 01:21:44 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2013-06-08 01:21:44 +0200
commitb8e9dbacdd60c5a20ab2c77c08f047b2b990f303 (patch)
tree5778963b48646331d9e4706a40c7b246f660c008 /fs
parentMerge branch 'for-3.10' of git://git.samba.org/sfrench/cifs-2.6 (diff)
parenteCryptfs: Check return of filemap_write_and_wait during fsync (diff)
downloadlinux-b8e9dbacdd60c5a20ab2c77c08f047b2b990f303.tar.xz
linux-b8e9dbacdd60c5a20ab2c77c08f047b2b990f303.zip
Merge tag 'ecryptfs-3.10-rc5-msync' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs
Pull ecryptfs fixes from Tyler Hicks: - Fixes how eCryptfs handles msync to sync both the upper and lower file - A couple of MAINTAINERS updates * tag 'ecryptfs-3.10-rc5-msync' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs: eCryptfs: Check return of filemap_write_and_wait during fsync Update eCryptFS maintainers ecryptfs: fixed msync to flush data
Diffstat (limited to 'fs')
-rw-r--r--fs/ecryptfs/file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 201f0a0d6b0a..a7abbea2c096 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -295,6 +295,12 @@ 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)
{
+ int rc;
+
+ rc = filemap_write_and_wait(file->f_mapping);
+ if (rc)
+ return rc;
+
return vfs_fsync(ecryptfs_file_to_lower(file), datasync);
}