Skip to content

Commit

Permalink
eCryptfs: Check return of filemap_write_and_wait during fsync
Browse files Browse the repository at this point in the history
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+
  • Loading branch information
tyhicks committed Jun 5, 2013
1 parent 24a923e commit bc5abcf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/ecryptfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +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)
{
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);
}

Expand Down

0 comments on commit bc5abcf

Please sign in to comment.