From: Darrick J. Wong Date: Wed, 31 May 2023 09:02:21 +0000 (+0200) Subject: xfs: hoist rmap record flag checks from scrub X-Git-Tag: v6.4.0~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3c8146ec425df6cc4e072d7cab35e89d9f34467;p=thirdparty%2Fxfsprogs-dev.git xfs: hoist rmap record flag checks from scrub Source kernel commit: e774b2ea0bb130d00e3cb1c29cd91028d0c0c83d 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 Signed-off-by: Carlos Maiolino --- diff --git a/libxfs/xfs_rmap.c b/libxfs/xfs_rmap.c index 4657d7da7..2a05cdba8 100644 --- a/libxfs/xfs_rmap.c +++ b/libxfs/xfs_rmap.c @@ -253,6 +253,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; }