Re: [PATCH 2/2] xfs: update dir3 leaf block metadata after swap

From: Christoph Hellwig
Date: Wed Nov 29 2023 - 01:34:30 EST


On Wed, Nov 29, 2023 at 10:15:52AM +1100, Dave Chinner wrote:
> > + /*
> > + * Update the moved block's blkno if it's a dir3 leaf block
> > + */
> > + if (dead_info->magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) ||
> > + dead_info->magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC) ||
> > + dead_info->magic == cpu_to_be16(XFS_ATTR3_LEAF_MAGIC)) {
>
> a.k.a.
>
> if (xfs_has_crc(mp)) {
>
> i.e. this is not specific to the buffer type being processed, it's
> specific to v4 vs v5 on-disk format. Hence it's a fs-feature check,
> not a block magic number check.

We have these magic based checks in quite a few places right now,
so I'm not surprised that Jiachen picked it up from there..