Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[firefly-linux-kernel-4.4.55.git] / fs / ecryptfs / file.c
index 7d1050e254f9c85a84bdab5cf8b5cf1bb36a8a5c..cedc913d11ba908f62be8711190a0883f4e95fbe 100644 (file)
@@ -273,7 +273,14 @@ static int ecryptfs_release(struct inode *inode, struct file *file)
 static int
 ecryptfs_fsync(struct file *file, int datasync)
 {
-       return vfs_fsync(ecryptfs_file_to_lower(file), datasync);
+       int rc = 0;
+
+       rc = generic_file_fsync(file, datasync);
+       if (rc)
+               goto out;
+       rc = vfs_fsync(ecryptfs_file_to_lower(file), datasync);
+out:
+       return rc;
 }
 
 static int ecryptfs_fasync(int fd, struct file *file, int flag)