Skip to content

Commit fca20fc

Browse files
Yuto Ohnukicmaiolino
authored andcommitted
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>
1 parent af47a4b commit fca20fc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

fs/xfs/scrub/dabtree.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,12 @@ xchk_da_btree_block(
454454
}
455455
}
456456

457-
/* XXX: Check hdr3.pad32 once we know how to fix it. */
457+
if (xfs_has_crc(ip->i_mount)) {
458+
struct xfs_da3_node_hdr *nodehdr3 = blk->bp->b_addr;
459+
460+
if (nodehdr3->__pad32)
461+
xchk_da_set_preen(ds, level);
462+
}
458463
break;
459464
default:
460465
xchk_da_set_corrupt(ds, level);

0 commit comments

Comments
 (0)