xfs: hoist rmap record flag checks from scrub

Move the rmap record flag checks from xchk_rmapbt_rec into
xfs_rmap_check_irec so that they are applied everywhere.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
Darrick J. Wong 2023-04-11 19:00:06 -07:00
parent 7d7d6d2fd0
commit e774b2ea0b
1 changed files with 5 additions and 0 deletions

View File

@ -254,6 +254,11 @@ xfs_rmap_check_irec(
if (!is_inode && (is_bmbt || is_unwritten || is_attr))
return __this_address;
/* Check for a valid fork offset, if applicable. */
if (is_inode && !is_bmbt &&
!xfs_verify_fileext(mp, irec->rm_offset, irec->rm_blockcount))
return __this_address;
return NULL;
}