aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTyler Hicks <tyhicks@canonical.com>2013-06-04 13:24:56 -0400
committerTyler Hicks <tyhicks@canonical.com>2013-06-05 02:53:31 -0400
commitbc5abcf7e411b889f73ea2a90439071a0f451011 (patch)
treeab1b98a7863fdd9bf80fb8e98d6bd41bae78be1c /fs
parent24a923e4e9a296a8f8ff852109d423ba07616cc4 (diff)
eCryptfs: Check return of filemap_write_and_wait during fsync
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> Cc: stable@vger.kernel.org # v3.6+
Diffstat (limited to 'fs')
-rw-r--r--fs/ecryptfs/file.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 16f509d6fa49..a7abbea2c096 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -295,7 +295,12 @@ static int ecryptfs_release(struct inode *inode, struct file *file)
295static int 295static int
296ecryptfs_fsync(struct file *file, loff_t start, loff_t end, int datasync) 296ecryptfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
297{ 297{
298 filemap_write_and_wait(file->f_mapping); 298 int rc;
299
300 rc = filemap_write_and_wait(file->f_mapping);
301 if (rc)
302 return rc;
303
299 return vfs_fsync(ecryptfs_file_to_lower(file), datasync); 304 return vfs_fsync(ecryptfs_file_to_lower(file), datasync);
300} 305}
301 306