[RHEL7,COMMIT] ms/fuse: use filemap_check_errors()

Submitted by Konstantin Khorenko on June 18, 2018, 9:02 a.m.

Details

Message ID 201806180902.w5I920OU019328@finist_ce7.work
State New
Series "ms/fuse: use filemap_check_errors()"
Headers show

Commit Message

Konstantin Khorenko June 18, 2018, 9:02 a.m.
The commit is pushed to "branch-rh7-3.10.0-862.3.2.vz7.61.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.3.2.vz7.61.3
------>
commit 95419166d7eceb057e0fd01b3fd9b11d108216ed
Author: Miklos Szeredi <mszeredi@redhat.com>
Date:   Mon Jun 18 12:02:00 2018 +0300

    ms/fuse: use filemap_check_errors()
    
    mainline commit 4a7f4e88 ("fuse: use filemap_check_errors()")
    
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    
    https://pmc.acronis.com/browse/VSTOR-10912
    Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 fs/fuse/file.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index bb4ddf2452d8..bd57d7cf5faf 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -644,10 +644,7 @@  static int fuse_flush(struct file *file, fl_owner_t id)
 	fuse_sync_writes(inode);
 	mutex_unlock(&inode->i_mutex);
 
-	if (test_and_clear_bit(AS_ENOSPC, &file->f_mapping->flags))
-		err = -ENOSPC;
-	if (test_and_clear_bit(AS_EIO, &file->f_mapping->flags))
-		err = -EIO;
+	err = filemap_check_errors(file->f_mapping);
 	if (err)
 		return err;
 
@@ -722,10 +719,7 @@  int fuse_fsync_common(struct file *file, loff_t start, loff_t end,
 	/* Due to implementation of fuse writeback filemap_write_and_wait_range()
 	 * does not catch errors. We have to do this directly after fuse_sync_writes()
 	 */
-	if (test_and_clear_bit(AS_ENOSPC, &file->f_mapping->flags))
-		err = -ENOSPC;
-	if (test_and_clear_bit(AS_EIO, &file->f_mapping->flags))
-		err = -EIO;
+	err = filemap_check_errors(file->f_mapping);
 	if (err)
 		goto out;