Re: [PATCH 4/4] xfs: fix sparse reported log CRC endian issue

Ben Myers
2012-11-29T20:30:34Z

On Thu, Nov 29, 2012 at 08:31:10AM +1100, Dave Chinner wrote:
> On Wed, Nov 28, 2012 at 08:30:59AM -0500, Christoph Hellwig wrote:
> > On Wed, Nov 28, 2012 at 01:01:03PM +1100, Dave Chinner wrote:
> > > From: Dave Chinner <dchinner@redhat.com>
> > >
> > > Not a bug as such, just warning noise from the xlog_cksum()
> > > returning a __be32 type when it shoul dbe returning a __le32 type.
> > >
> > > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> >
> > The patch look okay.
> >
> > But why are we storing the crc field little endian while all other on
> > disk formats are big endian? (And yes I realize it might as well have
> > been me who did that back in the idea, but I still have no idea why)
>
> Because the CRC always returns the calcuation LE format, even on BE
> systems. So rather than always having to byte swap it everywhere and
> have all the force casts and anootations for sparse, it seems
> simpler to just make it a __le32 everywhere....

This seems reasonable to me, and the patch looks fine. Christoph, do have any
further objection?

Reviewed-by: Ben Myers <bpm@sgi.com>