Re: [PATCH 10/10] repair: BMBT prefetch needs to be CRC aware

Dave Chinner
2014-02-25T23:51:16Z

On Tue, Feb 25, 2014 at 09:25:18AM -0800, Christoph Hellwig wrote:
> > /*
> > * do some validation on the block contents
> > */
> > - if ((be32_to_cpu(block->bb_magic) != XFS_BMAP_MAGIC) ||
> > + if ((block->bb_magic != cpu_to_be32(XFS_BMAP_MAGIC) &&
> > + block->bb_magic != cpu_to_be32(XFS_BMAP_CRC_MAGIC)) ||
> > (be16_to_cpu(block->bb_level) != level))
>
> Seems like this should be factored into a well-documented helper
> function.

Sure, but it's way outside the scope of fixing this bug.
We'd need to start with the kernel code, then port it is userspace
and propagate it into all the utilities. Patches welcome ;)

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com