xfs: don't call xchk_bmap_check_rmaps for btree-format file forks
authorDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:26 +0000 (19:00 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:26 +0000 (19:00 -0700)
commit1e59fdb7d6157ff685a250e0873a015a2b16a4f2
tree551c11e030cb8d29a8a07f4b1aa6cf34ba9c7f59
parente8882f69b941b20704ea509ebfca2d8a123ad6e3
xfs: don't call xchk_bmap_check_rmaps for btree-format file forks

The logic at the end of xchk_bmap_want_check_rmaps tries to detect a
file fork that has been zapped by what will become the online inode
repair code.  Zapped forks are in FMT_EXTENTS with zero extents, and
some sort of hint that there's supposed to be data somewhere in the
filesystem.

Unfortunately, the inverted logic here is confusing and has the effect
that we always call xchk_bmap_check_rmaps for FMT_BTREE forks.  This is
horribly inefficient and unnecessary, so invert the logic to get rid of
this performance problem.  This has caused 8h delays in generic/333 and
generic/334.

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