diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-06-29 14:47:17 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-07-06 10:46:56 -0700 |
commit | eb0efe5063bb10bcb653e4f8e92a74719c03a347 (patch) | |
tree | d19ebb06f0061e1d999ea4e3106251d1b31eecea /fs/xfs/xfs_reflink.c | |
parent | f74681ba2006434be195402e0b15fc5763cddd7e (diff) | |
download | linux-stable-eb0efe5063bb10bcb653e4f8e92a74719c03a347.tar.gz linux-stable-eb0efe5063bb10bcb653e4f8e92a74719c03a347.tar.bz2 linux-stable-eb0efe5063bb10bcb653e4f8e92a74719c03a347.zip |
xfs: don't eat an EIO/ENOSPC writeback error when scrubbing data fork
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: 99d9d8d05da2 ("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>
Diffstat (limited to 'fs/xfs/xfs_reflink.c')
0 files changed, 0 insertions, 0 deletions