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 <[email protected]>
Cc: Paul Taysom <[email protected]>
Cc: Olof Johansson <[email protected]>
Cc: [email protected] # v3.6+
This commit is contained in:
Tyler Hicks 2013-06-04 10:24:56 -07:00
commit bc5abcf7e4

View file

@ -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);
}