Commit fca20fcb authored by Yuto Ohnuki's avatar Yuto Ohnuki Committed by Carlos Maiolino
Browse files

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: default avatarYuto Ohnuki <ytohnuki@amazon.com>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent af47a4be
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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);