Merge tag 'btree-complain-bad-records-6.4_2023-04-11' of git://git.kernel.org/pub...
authorDave Chinner <david@fromorbit.com>
Thu, 13 Apr 2023 21:09:18 +0000 (07:09 +1000)
committerDave Chinner <dchinner@redhat.com>
Thu, 13 Apr 2023 21:09:18 +0000 (07:09 +1000)
commit01822a74ca5e49dfdc4003be21cb96e4f3d42606
tree9d92ba4be2fba90217a93857128122c00bd9ad05
parentb634abac59acc0e4397c5cf420278b32a6e0b69e
parent6a3bd8fcf9afb47c703cb268f30f60aa2e7af86a
Merge tag 'btree-complain-bad-records-6.4_2023-04-11' of git://git./linux/kernel/git/djwong/xfs-linux into guilt/xfs-for-next

xfs: standardize btree record checking code [v24.5]

While I was cleaning things up for 6.1, I noticed that the btree
_query_range and _query_all functions don't perform the same checking
that the _get_rec functions perform.  In fact, they don't perform /any/
sanity checking, which means that callers aren't warned about impossible
records.

Therefore, hoist the record validation and complaint logging code into
separate functions, and call them from any place where we convert an
ondisk record into an incore record.  For online scrub, we can replace
checking code with a call to the record checking functions in libxfs,
thereby reducing the size of the codebase.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_inode_fork.c