diff options
author | Tyler Hicks <tyhicks@canonical.com> | 2013-06-04 10:24:56 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-13 10:49:32 -0700 |
commit | 4dbfc6cccf119acb59d9cf8853a78890c81e21c5 (patch) | |
tree | 47e30753dea8a9fe9e0981d28ff93c9bbe534c53 /fs | |
parent | ef6190a2ac96fa2156c5e1423d1ea84a1cdf1bda (diff) |
eCryptfs: Check return of filemap_write_and_wait during fsync
commit bc5abcf7e411b889f73ea2a90439071a0f451011 upstream.
Error out of ecryptfs_fsync() if filemap_write_and_wait() fails.
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Cc: Paul Taysom <taysom@chromium.org>
Cc: Olof Johansson <olofj@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ecryptfs/file.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index a19022fe130f..3d7fb593f08e 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c @@ -294,7 +294,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) { - filemap_write_and_wait(file->f_mapping); + int rc; + + rc = filemap_write_and_wait(file->f_mapping); + if (rc) + return rc; + return vfs_fsync(ecryptfs_file_to_lower(file), datasync); } |