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;
* 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;