[parted-devel] [PATCH] dos: improve MBR signature generation

Jonathan Liu net147 at gmail.com
Fri Sep 27 01:21:56 UTC 2013


On 27 September 2013 09:43, H. Peter Anvin <hpa at zytor.com> wrote:
> On 09/26/2013 04:40 PM, H. Peter Anvin wrote:
>> On 05/18/2013 06:57 AM, Jonathan Liu wrote:
>>> -    return (uint32_t)(tv.tv_usec & 0xFFFFFFFFUL);
>>
>> Good change.
>>
>> The above code must be generally considered a Whiskey Tango Foxtrot
>> since there maximum value for tv_usec is 0x000f423f... which is one
>> reason so many MBRs generated on Linux systems have signatures that fall
>> inside this narrow range.
>>
>
> One additional thing on this: please check for zero.  A zero MBR ID is
> generally seen as "no ID" and another partitioning program might install
> a new ID.
>
>         -hpa
>
>

Patch V2 submitted with check for zero.

Regards,
Jonathan



More information about the parted-devel mailing list