[parted-devel] [PATCH 6/6] libparted: fix optimal IO alignment

Jim Meyering jim at meyering.net
Sun Dec 16 07:09:45 UTC 2012


Phillip Susi wrote:

> On 12/15/2012 08:44 PM, Jim Meyering wrote:
>> That code seems to be trying to exclude opt/min values that do not
>> evenly divide PED_DEFAULT_ALIGNMENT.  That makes sense only when
>> they're no larger than PED_DEFAULT_ALIGNMENT. How about keeping the
>> sanity-check, but applying it only when those values are no larger?
>> I.e.,
>
> Why do you think it makes sense when the kernel value is under 1 MB?
> PED_DEFAULT_ALIGNMENT is all well and good when the kernel doesn't
> know of a better value, but if it thinks that the optimal alignment is
> say, 768k, why should we disregard that?

I'd be suspicious because it's smaller than 1MiB and not a power of 2.
Have you seen opt/min values like that?

I suspect that the existing code is the way it is for a good reason,
hence my reluctance to gut it.
What if some system reports totally bogus min. or opt. values < 1MiB?
As it is now, parted will ignore them.  But with your patch,
it would use them and leave the user with poorly-aligned partitions.



More information about the parted-devel mailing list