[parted-devel] Bug: Removal of BLKPG causes regression of ability to manipulate disks with other partitions in use

Petr Uzel petr.uzel at suse.cz
Tue Mar 30 10:26:31 UTC 2010


On Mon, Mar 29, 2010 at 12:23:11PM -0400, Phillip Susi wrote:
> On 3/29/2010 12:11 PM, Petr Uzel wrote:
> > Imagine you add partitions with parted in a script. Then the ioctl()s
> > are:
> > 
> > #create 1st partition
> > BLKPG_ADD_PART (sda1)  [A]
> > 
> > #create 2nd partition
> > BLKPG_DEL_PART (sda1)  [B]
> > BLKPG_ADD_PART (sda1)
> > BLKPG_ADD_PART (sda2)
> > 
> > [A] triggers udev, which runs hal, which asynchronously opens
> > /dev/sda1
> > [B] sda1 is still opened by hal -> EBUSY
> > 
> > And there is a good chance that 0.5s after [B], the hal will release
> > the device and BLKPG would succeed.
> 
> This is not a problem since when you get EBUSY removing A, it is ignored
> since A is unmodified.  It does not matter whether A is busy because of
> a transient open from hal, or because it has actually been mounted,
> since we aren't trying to modify it, we don't care that it is busy.

You are right - I did not realize this, sorry.

There is still the (subtle) issue with subsequent changes of the same
partition, but honestly I can not imagine any real life use case that
needs to do that - so I think we could eventually add the wait & retry
later, if it turns out that it is needed.


Thanks,

Petr

--
Petr Uzel, openSUSE Boosters Team
IRC: ptr_uzl @ freenode



More information about the parted-devel mailing list