[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: gcc bug causes parted to write bad GPT entries

From: Matt_Domsch
Subject: RE: gcc bug causes parted to write bad GPT entries
Date: Mon, 18 Mar 2002 16:47:36 -0600

> This code would never have worked on a big-endian CPU anyway - it does
> all it's crc checks _after_ byteswapping the various fields in the
> header and table entries to local cpu byte order, and generates before
> switching back to LE byte order.

Indeed.  Oops.
> Is anyone playing with GPT on big-endian anywhere?  If so, fixing this
> is going to cause them some pain.

No, I've not heard of anyone using it on BE systems.  So far it's pretty
restricted to Intel IA-64 and IA-32 platforms, both of which are LE.

It might make sense to declare that data in the structures is always LE, and
drop the conversion between on-disk and memory.
Then, on structure access, use macros that on LE just return the structure
member, and on BE, swab on access, but the data in the structures never
changes.  Then, none of this "what format is it in" business.  It's always
LE, and to access the structure members, you've got to use macros.



Matt Domsch
Sr. Software Engineer
Dell Linux Solutions www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
#1 US Linux Server provider for 2001!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]