[parted-devel] [PATCH] Revert small device commits

Phillip Susi psusi at ubuntu.com
Sun Dec 30 14:53:26 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/30/2012 02:50 AM, Jim Meyering wrote:
> Phillip Susi wrote:
>> The following commit broke the position of the LastUsableLBA:
> 
> Hi Phillip, Thanks for the patch, but I don't understand the above
> explanation.
> 
> What motivated you to make this change?

I was rebasing one of the patches I did earlier for fixing the gpt
backup location to try and add a test case as you requested and after
turning myself around a few times thinking I had an off by one error,
I realized it was parted that was setting the LastUsableLBA field to
the wrong value.  Rather than the LBA of the last usable sector, it
actually held the LBA of the first sector of the partition table
array, as a result of this commit.

>> 48f236f9: gpt: permit "mklabel gpt" on a 67-sector device
>> 
>> This effectively reverts that commit, as well as adjusting the
>> subsequent commits to instead use 68 sectors as the minimum
>> length, since there appears to be other parted code that can not
>> cope with a partition table without room for at least a 1 sector
>> partition,
> 
> Please provide details of the above.

The geometry code rejects zero length geometries with the error:
"Can't have the end before the start!"  I'm not sure if that is the
only problem or not, but I didn't feel it was worth looking into since
a partition table that can't hold partitions is useless.

> IMHO, there is value in testing the limits of the code. Unless the
> specification prohibits it -- or maybe if it's too hard to do right
> -- I would like to support it.

For what it's worth, gdisk accepted a 67 sector disk, but it set
LastUsableLBA = FirstUsableLba - 1, which parted will barf on.

The test suite still tests the limits of the code, and makes sure a
proper diagnostic is issued when given too small of a disk.



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQ4FVmAAoJEJrBOlT6nu75gOsH/3DMquCpEfZ+bdXVRfoSVaom
B/gZqe6cVPah7aXPMx+5CNchCn1TjBQnhu82FINUI9TvEggIX6vTkiOV+UiDkxD7
BqClcNc6PpyZ+YEGa9yLznreutD/0EEDCi4uoEyme32bQTiAfHqIgAj08q74d0IN
MpMC5h8QZWF3yt3KHQ1NatoBU3egBEzZzMk06RSQV0yxFPCuarIHOrju4yg3P2m7
JZRfu0vtmJWabkKxSGyjOvICWP48cK553Y6u6K2m212z9CZyiTNWPGBLVWXlwaw+
10MNTdYihE+c1g/CFb5OxKh3g/2XbxPV7zlQ8wONPCEE15d0eVOUj4/xDrFxyGs=
=xeAE
-----END PGP SIGNATURE-----



More information about the parted-devel mailing list