xfs: check da node block pad field during scrub

The da node block header (xfs_da3_node_hdr) contains a __pad32 field
that should always be zero. Add a check for this during directory and
attribute btree scrubbing.

Since old kernels may have written non-zero padding without issues, flag
this as an optimization opportunity (preen) rather than corruption.

Signed-off-by: Yuto Ohnuki <ytohnuki@amazon.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
Yuto Ohnuki 2026-04-10 18:06:15 +01:00 committed by Carlos Maiolino
parent af47a4be6a
commit fca20fcb76

View File

@ -454,7 +454,12 @@ xchk_da_btree_block(
}
}
/* XXX: Check hdr3.pad32 once we know how to fix it. */
if (xfs_has_crc(ip->i_mount)) {
struct xfs_da3_node_hdr *nodehdr3 = blk->bp->b_addr;
if (nodehdr3->__pad32)
xchk_da_set_preen(ds, level);
}
break;
default:
xchk_da_set_corrupt(ds, level);