]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: hoist inode record alignment checks from scrub
authorDarrick J. Wong <djwong@kernel.org>
Wed, 31 May 2023 09:03:21 +0000 (11:03 +0200)
committerCarlos Maiolino <cem@kernel.org>
Fri, 9 Jun 2023 08:27:50 +0000 (10:27 +0200)
Source kernel commit: de1a9ce225e93b22d189f8ffbce20074bc803121

Move the inobt record alignment checks from xchk_iallocbt_rec into
xfs_inobt_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_ialloc.c

index fa5ac818014964bf0a592bb82bf29caa71fb6118..63c5b50bf69efebc34c33de8b26f751ddeaa3c23 100644 (file)
@@ -98,8 +98,12 @@ xfs_inobt_check_irec(
 {
        uint64_t                        realfree;
 
+       /* Record has to be properly aligned within the AG. */
        if (!xfs_verify_agino(cur->bc_ag.pag, irec->ir_startino))
                return __this_address;
+       if (!xfs_verify_agino(cur->bc_ag.pag,
+                               irec->ir_startino + XFS_INODES_PER_CHUNK - 1))
+               return __this_address;
        if (irec->ir_count < XFS_INODES_PER_HOLEMASK_BIT ||
            irec->ir_count > XFS_INODES_PER_CHUNK)
                return __this_address;