[Tux3] [PATCH 03/10] Fix ileaf aligment

OGAWA Hirofumi hirofumi at mail.parknet.co.jp
Fri Oct 17 02:59:33 PDT 2008


Daniel Phillips <phillips at phunq.net> writes:

>> -struct ileaf { u16 magic, count; inum_t ibase; char table[]; };
>> +struct ileaf { u16 magic, count; u32 pad; inum_t ibase; char table[]; };
>>  
>>  /*
>>   * inode leaf format
>
> Good catch.  A better way to fix this is using gcc attribute packed,
> which is done by the Tux3 macro PACKED:

But, I think the result of it is aliment fault on some archs.

>    struct ileaf { u16 magic, count; inum_t ibase; char table[]; } PACKED;
>
> We need to check all structs used for on-disk layout and make sure they
> are all declared packed.

I checked those by pahole. Looks good.
-- 
OGAWA Hirofumi <hirofumi at mail.parknet.co.jp>

_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://tux3.org/cgi-bin/mailman/listinfo/tux3



More information about the Tux3 mailing list