android_kernel_motorola_sm6225/fs/xfs/scrub
Darrick J. Wong 17979d8c8b xfs: don't eat an EIO/ENOSPC writeback error when scrubbing data fork
[ Upstream commit eb0efe5063bb10bcb653e4f8e92a74719c03a347 ]

The data fork scrubber calls filemap_write_and_wait to flush dirty pages
and delalloc reservations out to disk prior to checking the data fork's
extent mappings.  Unfortunately, this means that scrub can consume the
EIO/ENOSPC errors that would otherwise have stayed around in the address
space until (we hope) the writer application calls fsync to persist data
and collect errors.  The end result is that programs that wrote to a
file might never see the error code and proceed as if nothing were
wrong.

xfs_scrub is not in a position to notify file writers about the
writeback failure, and it's only here to check metadata, not file
contents.  Therefore, if writeback fails, we should stuff the error code
back into the address space so that an fsync by the writer application
can pick that up.

Fixes: 99d9d8d05d ("xfs: scrub inode block mappings")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19 08:14:56 +02:00
..
agheader.c xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
agheader_repair.c xfs: repair the AGI 2018-08-10 11:44:31 -07:00
alloc.c xfs: remove duplicated include from alloc.c 2018-09-29 13:48:21 +10:00
attr.c xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
bitmap.c xfs: repair the AGFL 2018-08-10 11:44:31 -07:00
bitmap.h xfs: repair the AGFL 2018-08-10 11:44:31 -07:00
bmap.c xfs: don't eat an EIO/ENOSPC writeback error when scrubbing data fork 2020-08-19 08:14:56 +02:00
btree.c xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
btree.h xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
common.c xfs: clean up IRELE/iput callsites 2018-07-26 10:15:16 -07:00
common.h xfs: periodically yield scrub threads to the scheduler 2020-01-09 10:19:09 +01:00
dabtree.c xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
dabtree.h xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
dir.c xfs: clean up IRELE/iput callsites 2018-07-26 10:15:16 -07:00
ialloc.c xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
inode.c xfs: don't treat unknown di_flags2 as corruption in scrub 2018-09-29 13:49:00 +10:00
parent.c xfs: clean up IRELE/iput callsites 2018-07-26 10:15:16 -07:00
quota.c xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
refcount.c xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
repair.c xfs: sanity check ag header values in xrep_calc_ag_resblks 2018-08-14 08:17:02 -07:00
repair.h xfs: repair the AGI 2018-08-10 11:44:31 -07:00
rmap.c xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
rtbitmap.c xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
scrub.c xfs: repair the AGI 2018-08-10 11:44:31 -07:00
scrub.h xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
symlink.c xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
trace.c xfs: fix indentation and other whitespace problems in scrub/repair 2018-07-23 09:08:01 -07:00
trace.h xfs: refactor the xrep_extent_list into xfs_bitmap 2018-07-31 13:18:08 -07:00
xfs_scrub.h xfs: convert to SPDX license tags 2018-06-06 14:17:53 -07:00