summaryrefslogtreecommitdiffstats
path: root/fs/libfs.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2017-07-06 13:02:21 +0200
committerJeff Layton <jlayton@redhat.com>2017-07-06 13:02:21 +0200
commitdac257f7419c732be3e491bbbb568a82df60208a (patch)
tree716ff1d0955826e258d73213aeb3053eb3c2fe53 /fs/libfs.c
parentbuffer: use mapping_set_error instead of setting the flag (diff)
downloadlinux-dac257f7419c732be3e491bbbb568a82df60208a.tar.xz
linux-dac257f7419c732be3e491bbbb568a82df60208a.zip
fs: check for writeback errors after syncing out buffers in generic_file_fsync
ext2 currently does a test+clear of the AS_EIO flag, which is is problematic for some coming changes. What we really need to do instead is call filemap_check_errors in __generic_file_fsync after syncing out the buffers. That will be sufficient for this case, and help other callers detect these errors properly as well. With that, we don't need to twiddle it in ext2. Suggested-by: Jan Kara <jack@suse.cz> Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
Diffstat (limited to 'fs/libfs.c')
-rw-r--r--fs/libfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/libfs.c b/fs/libfs.c
index a04395334bb1..1b76f29799bf 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -991,7 +991,9 @@ int __generic_file_fsync(struct file *file, loff_t start, loff_t end,
out:
inode_unlock(inode);
- return ret;
+ /* must call this unconditionally as it clears AS_* error flags */
+ err = filemap_check_errors(inode->i_mapping);
+ return ret ? ret : err;
}
EXPORT_SYMBOL(__generic_file_fsync);