Skip to content

Commit

Permalink
fuse: use filemap_check_errors()
Browse files Browse the repository at this point in the history
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
  • Loading branch information
Miklos Szeredi committed Jul 29, 2016
1 parent d72d9e2 commit 4a7f4e8
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,7 @@ static int fuse_flush(struct file *file, fl_owner_t id)
fuse_sync_writes(inode);
inode_unlock(inode);

if (test_bit(AS_ENOSPC, &file->f_mapping->flags) &&
test_and_clear_bit(AS_ENOSPC, &file->f_mapping->flags))
err = -ENOSPC;
if (test_bit(AS_EIO, &file->f_mapping->flags) &&
test_and_clear_bit(AS_EIO, &file->f_mapping->flags))
err = -EIO;
err = filemap_check_errors(file->f_mapping);
if (err)
return err;

Expand Down Expand Up @@ -477,12 +472,7 @@ int fuse_fsync_common(struct file *file, loff_t start, loff_t end,
* filemap_write_and_wait_range() does not catch errors.
* We have to do this directly after fuse_sync_writes()
*/
if (test_bit(AS_ENOSPC, &file->f_mapping->flags) &&
test_and_clear_bit(AS_ENOSPC, &file->f_mapping->flags))
err = -ENOSPC;
if (test_bit(AS_EIO, &file->f_mapping->flags) &&
test_and_clear_bit(AS_EIO, &file->f_mapping->flags))
err = -EIO;
err = filemap_check_errors(file->f_mapping);
if (err)
goto out;

Expand Down

0 comments on commit 4a7f4e8

Please sign in to comment.