mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
fuse: fsync() did not return IO errors
commitac7f052b9eupstream. 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() Signed-off-by: Alexey Kuznetsov <kuznet@virtuozzo.com> Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Fixes:4d99ff8f12("fuse: Turn writeback cache on") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
62659f0b9e
commit
3d1c64d81f
@@ -462,6 +462,21 @@ int fuse_fsync_common(struct file *file, loff_t start, loff_t end,
|
||||
goto out;
|
||||
|
||||
fuse_sync_writes(inode);
|
||||
|
||||
/*
|
||||
* 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_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;
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = sync_inode_metadata(inode, 1);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user