[parted-devel] [PATCH 1/2] libparted: enforce dos partition limit

H. Peter Anvin hpa at zytor.com
Mon Jan 23 18:39:20 UTC 2012


On 01/23/2012 10:22 AM, Phillip Susi wrote:
> 
> I think the enforcement needs to stay the way it is.  GPT enforces its
> limit, and arch/linux.c assumes that the limit the partition table
> advertises is actual and correct.  If that isn't the case, then linux.c
> and anyone else asking the pt for its limit probably needs refactored to
> not do so.  Advertising a limit that isn't actually a limit is wrong.
> 
> If you want to raise the limit to 256 or even higher then you could have
> more than 256 partitions on msdos, even though it isn't supported on linux.
> 
> Theoretically linux.c should then throw an exception complaining if the
> partition count exceeds that supported by the kernel, though I'm not
> sure fixing that is particularly important since parted has gone this
> long without complaining if you exceeded the old limit of 16, and now
> the limit is 256 it is even less of an issue.

GPT enforces its limit because *that's how many slots there are in the
partition table* (by the way, you *do* handle GPT partition tables with
more than 128 slots, right?)

Newer Linux kernel s have an overflow system which is at least supposed
to allow for additional partitions without problems; if that is broken
then that is a kernel bug, and playing games in parted will just make it
harder to diagnose and fix.

	-hpa
-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.




More information about the parted-devel mailing list