[parted-devel] [PATCH] libparted: only IEC units are treated as exact

Brian C. Lane bcl at redhat.com
Wed Aug 10 23:46:51 UTC 2016


On Thu, Jul 21, 2016 at 04:46:46PM +0200, Petr Uzel wrote:
> If the user specifies start/end of the partition as a unit,
> whose size happens to be power of two, we treat that as
> exact address with exact placement.
> 
> Recently, commit 01900e056ec25083 added an exception for
> percent units.
> 
> This logic however can fail also for cylinders, e.g. on DASD FBA disks,
> which report CHS=(*, 128, 16) geometry, hence once cylinder is 1 MiB.
> With cylinders as units, exact placement is not what the user wants.
> 
> Instead of adding cylinders to the blacklist, let's instead
> whitelist units which should trigger exact placement.
> 
> * libparted/unit.c (is_power_of_2): Remove now unused function.
> (ped_unit_parse_custom): Specify which units trigger exact placement.
> * NEWS (Bug Fixes): Mention this.

Looks good to me.

-- 
Brian C. Lane | Port Orchard, WA (PST8PDT)



More information about the parted-devel mailing list