summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-04-11 19:00:06 -0700
committerDarrick J. Wong <djwong@kernel.org>2023-04-11 19:00:06 -0700
commitde1a9ce225e93b22d189f8ffbce20074bc803121 (patch)
treed289bc32456212447a7cbfe91e19483be5e40e58 /fs/xfs/libxfs
parente774b2ea0bb130d00e3cb1c29cd91028d0c0c83d (diff)
downloadlinux-de1a9ce225e93b22d189f8ffbce20074bc803121.tar.gz
linux-de1a9ce225e93b22d189f8ffbce20074bc803121.tar.bz2
linux-de1a9ce225e93b22d189f8ffbce20074bc803121.zip
xfs: hoist inode record alignment checks from scrub
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>
Diffstat (limited to 'fs/xfs/libxfs')
-rw-r--r--fs/xfs/libxfs/xfs_ialloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index b7dc8b81a133..0d2980accd3c 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -103,8 +103,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;