]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: check record domain when accessing refcount records
authorDarrick J. Wong <djwong@kernel.org>
Wed, 26 Oct 2022 21:16:36 +0000 (14:16 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 31 Oct 2022 15:58:21 +0000 (08:58 -0700)
commit5f063ac40df70dff23d185369d0beba5c884e558
tree24f6eb1e62e928d76786f3f9a33bd146abc0d3cc
parent094873590fb465973e263700bb768775b0ec7d3e
xfs: check record domain when accessing refcount records

Now that we've separated the startblock and CoW/shared extent domain in
the incore refcount record structure, check the domain whenever we
retrieve a record to ensure that it's still in the domain that we want.
Depending on the circumstances, a change in domain either means we're
done processing or that we've found a corruption and need to fail out.

The refcount check in xchk_xref_is_cow_staging is redundant since
_get_rec has done that for a long time now, so we can get rid of it.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/libxfs/xfs_refcount.c
fs/xfs/scrub/refcount.c