]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: hoist rmap record flag checks from scrub
authorDarrick J. Wong <djwong@kernel.org>
Wed, 31 May 2023 09:02:21 +0000 (11:02 +0200)
committerCarlos Maiolino <cem@kernel.org>
Fri, 9 Jun 2023 08:27:50 +0000 (10:27 +0200)
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 <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_rmap.c

index 4657d7da7ff3fd278ae2d5c11fedf7f7519bcd82..2a05cdba8e9549958ef59e738f3e4d4d80cc5729 100644 (file)
@@ -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;
 }