From: Darrick J. Wong Date: Wed, 12 Apr 2023 02:00:06 +0000 (-0700) Subject: xfs: hoist rmap record flag checks from scrub X-Git-Tag: v6.6.7~2856^2~26^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e774b2ea0bb130d00e3cb1c29cd91028d0c0c83d;p=platform%2Fkernel%2Flinux-starfive.git 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 Reviewed-by: Dave Chinner --- diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c index e66ecd7..da008d3 100644 --- a/fs/xfs/libxfs/xfs_rmap.c +++ b/fs/xfs/libxfs/xfs_rmap.c @@ -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; }