Re: [PATCH] (and bad attr2 bug) - pack xfs_sb_t for 64-bit arches

David Chinner
2006-11-17T02:41:00Z

On Fri, Nov 17, 2006 at 11:08:40AM +1000, Timothy Shimmin wrote:
> Hi Eric,
>
>
> Well there is a bug in the sb endian translation code then or its setup.
> All the field accesses should be correct, no?

The problem is the size of the variable translated in xfs_xlatesb()
is the offset of the next field minus the offset of the current
field.

With the last filed of the structure, it ends up being the
size of the structure minus the offset of the field. On a 32 bit
machine, the structure is 4 bytes larger that the offset of
the feature2 field. On 64 bit machine, the strucutre is
8 bytes larger than the offset of the features2 field,
so it translates is as though it was a 64 bit field,
not a 32 bit field.....

Cheers,

Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group