Commit de1a9ce2 authored by Darrick J. Wong's avatar Darrick J. Wong

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: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent e774b2ea
...@@ -103,8 +103,12 @@ xfs_inobt_check_irec( ...@@ -103,8 +103,12 @@ xfs_inobt_check_irec(
{ {
uint64_t realfree; uint64_t realfree;
/* Record has to be properly aligned within the AG. */
if (!xfs_verify_agino(cur->bc_ag.pag, irec->ir_startino)) if (!xfs_verify_agino(cur->bc_ag.pag, irec->ir_startino))
return __this_address; 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 || if (irec->ir_count < XFS_INODES_PER_HOLEMASK_BIT ||
irec->ir_count > XFS_INODES_PER_CHUNK) irec->ir_count > XFS_INODES_PER_CHUNK)
return __this_address; return __this_address;
......
...@@ -413,7 +413,6 @@ xchk_iallocbt_rec( ...@@ -413,7 +413,6 @@ xchk_iallocbt_rec(
const union xfs_btree_rec *rec) const union xfs_btree_rec *rec)
{ {
struct xfs_mount *mp = bs->cur->bc_mp; struct xfs_mount *mp = bs->cur->bc_mp;
struct xfs_perag *pag = bs->cur->bc_ag.pag;
struct xchk_iallocbt *iabt = bs->private; struct xchk_iallocbt *iabt = bs->private;
struct xfs_inobt_rec_incore irec; struct xfs_inobt_rec_incore irec;
uint64_t holes; uint64_t holes;
...@@ -431,11 +430,6 @@ xchk_iallocbt_rec( ...@@ -431,11 +430,6 @@ xchk_iallocbt_rec(
} }
agino = irec.ir_startino; agino = irec.ir_startino;
/* Record has to be properly aligned within the AG. */
if (!xfs_verify_agino(pag, agino + XFS_INODES_PER_CHUNK - 1)) {
xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
goto out;
}
xchk_iallocbt_rec_alignment(bs, &irec); xchk_iallocbt_rec_alignment(bs, &irec);
if (bs->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) if (bs->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment