[parted-devel] [BUG] failing ioctl when informing the kernel about new partitions

Bryn M. Reeves bmr at redhat.com
Thu Jan 15 16:24:05 UTC 2009


Petr Uzel wrote:
> On Thu, Jan 15, 2009 at 03:23:16PM +0000, Bryn M. Reeves wrote:
>> Petr Uzel wrote:
>>> But isn't BKLPG interface superior to BLKRRPART in the fact that the
>>> kernel doesn't need to have support for particular type of disk label
>>> compiled in? If this is true, then it might be worth trying to extend
>>> BLKPG interface to support this kind of overlapping partitions instead
>>> of reverting back to BLKRRPART. What do you think?
>> To come back to this specific point: I considered this some time ago 
>> but didn't follow up on it as it seemed there were some difficult 
>> problems.
>>
>> We could just relax all the constraints on BLKPG and let userspace do 
>> whatever it wants, but that seems like it creates potential for a 
>> misbehaving userspace tool to cause serious chaos.
>>
>> An alternative is to extend the interface to allow extra annotation 
>> (e.g. to some how express that two partitions have a relationship such 
>> as exists with DOS MBRs and extended/logical partitions).
> 
> Something similar came to my mind - extend the interface with some flag
> saying "this is an extended partition and if that overlaps with
> something behind it, it is OK". Shouldn't be difficult.
> 

The reason I didn't like this is it seems to pollute the BLKPG 
interface (which is intentionally label agnostic) with concepts like 
"extended partition" that are very specific to certain weird disk 
label formats. That said, MSDOS is certainly in wide enough use that 
it probably deserves some special treatment.

For this to work though I think it has to have some constraints - 
allowing arbitrary overlaps seems like a recipe for problems. I 
believe the "shared sector" case for extended partitions is fairly 
straightforward but we'd need to consider whether there may be other 
cases that need to be addressed now or in the future.

I can't think of any off hand - partition formats thankfully seem to 
have gotten more sane since the 80s but I am not overly familiar with 
some of the more complex uses of BSD/Sun and other disk label formats. 
Can anyone comment as to whether these ever include overlaps that 
would also need this handling?

Regards,
Bryn.



More information about the parted-devel mailing list