• Darrick J. Wong's avatar
    xfs: don't eat an EIO/ENOSPC writeback error when scrubbing data fork · eb0efe50
    Darrick J. Wong authored
    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: 99d9d8d0 ("xfs: scrub inode block mappings")
    Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    eb0efe50
bmap.c 20.1 KB