Files
android_kernel_xiaomi_sm8450/fs/xfs/libxfs
Darrick J. Wong ce99494c96 xfs: fix buffer corruption reporting when xfs_dir3_free_header_check fails
xfs_verifier_error is supposed to be called on a corrupt metadata buffer
from within a buffer verifier function, whereas xfs_buf_mark_corrupt
is the function to be called when a piece of code has read a buffer and
catches something that a read verifier cannot.  The first function sets
b_error anticipating that the low level buffer handling code will see
the nonzero b_error and clear XBF_DONE on the buffer, whereas the second
function does not.

Since xfs_dir3_free_header_check examines fields in the dir free block
header that require more context than can be provided to read verifiers,
we must call xfs_buf_mark_corrupt when it finds a problem.

Switching the calls has a secondary effect that we no longer corrupt the
buffer state by setting b_error and leaving XBF_DONE set.  When /that/
happens, we'll trip over various state assertions (most commonly the
b_error check in xfs_buf_reverify) on a subsequent attempt to read the
buffer.

Fixes: bc1a09b8e3 ("xfs: refactor verifier callers to print address of failing check")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2020-03-12 07:58:12 -07:00
..
2019-11-07 13:00:53 -08:00
2020-03-11 09:11:39 -07:00
2020-03-11 09:11:39 -07:00
2020-03-02 20:55:53 -08:00
2020-03-02 20:55:55 -08:00
2019-11-07 13:00:53 -08:00
2018-06-06 14:17:53 -07:00
2020-03-11 09:11:39 -07:00
2020-03-02 20:55:55 -08:00
2020-03-11 09:11:38 -07:00
2020-03-11 09:11:38 -07:00
2020-03-11 09:11:39 -07:00
2020-03-11 09:11:39 -07:00
2019-06-12 08:37:40 -07:00
2019-06-28 19:30:43 -07:00