xfs: check overlapping rmap btree records
authorDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:27 +0000 (19:00 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:27 +0000 (19:00 -0700)
commit29ab991b4fe9df3cb6f943bea9e256fbdfa93589
tree91de59db2f2b56a017cf3f895b6257d413ce2605
parentdb0502b39c21d1cab6b6778a416a5b407170be90
xfs: check overlapping rmap btree records

The rmap btree scrubber doesn't contain sufficient checking for records
that cannot overlap but do anyway.  For the other btrees, this is
enforced by the inorder checks in xchk_btree_rec, but the rmap btree is
special because it allows overlapping records to handle shared data
extents.

Therefore, enhance the rmap btree record check function to compare each
record against the previous one so that we can detect overlapping rmap
records for space allocations that do not allow sharing.

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