xfs: hoist rmap record flag checks from scrub

JIRA: https://issues.redhat.com/browse/RHEL-25419

commit e774b2ea0bb130d00e3cb1c29cd91028d0c0c83d
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Tue Apr 11 19:00:06 2023 -0700

    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>

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
This commit is contained in:
Bill O'Donnell 2024-06-05 16:56:19 -05:00
parent f3724d2a82
commit 05c08adeb3
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)) if (!is_inode && (is_bmbt || is_unwritten || is_attr))
return __this_address; 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; return NULL;
} }