Otavio Salvador <[EMAIL PROTECTED]> wrote:

> Jim Meyering <[EMAIL PROTECTED]> writes:
>
>> diff --git a/libparted/labels/bsd.c b/libparted/labels/bsd.c
>> index 747a9c5..26a8b60 100644
>> --- a/libparted/labels/bsd.c
>> +++ b/libparted/labels/bsd.c
>> @@ -141,30 +142,45 @@ alpha_bootblock_checksum (char *boot) {
> <...>
>>  static int
>>  bsd_probe (const PedDevice *dev)
>>  {
>> -    char            boot[512];
>> -    BSDRawLabel     *label;
>> +    BSDRawLabel     *partition;
>>
>>      PED_ASSERT (dev != NULL, return 0);
>>
>> -        if (dev->sector_size != 512)
>> +        if (dev->sector_size < 512)
>>                  return 0;
>
> Shouldn't it be:
>            if (dev->sector_size%512 != 0)
>                    return 0;

Thanks for looking at it, but no.

First, your replacement would mistakenly allow a dev->sector_size value
of 0 through.  More importantly, there is already plenty of code (e.g.,
in linux.c) that ensures it is a multiple of 512, so it would be redundant
to check for that in each label/*.c's *_probe function.

BTW, there are still many functions that won't work with larger sector size.
For example, I've just noticed that bsd.c's _probe_and_add_boot_code
assumes 512-byte sectors, too, but it's not exercised by the label
reading/writing code that I'm using to test things in this first round.

_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to