[parted-devel] [PATCH] libparted: Use flock to lock access to the device

Brian C. Lane bcl at redhat.com
Thu Sep 24 00:36:31 UTC 2015


On Mon, Sep 21, 2015 at 03:45:39PM -0400, Phil Susi wrote:
> On 8/11/2015 4:49 PM, Brian C. Lane wrote:
> > It is possible for other processes, espceially udev, to try and access
> > the device while parted is examining it or making changes. This tries to
> > get an exclusive lock on the device when it is opened for RW access. If
> > it fails it prints a warning and continues on.
> 
> How about delaying and retrying the lock say, every 10ms for up to
> 1000ms first?

Yeah, we could do that. add LOCK_NB and a timer. 

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)



More information about the parted-devel mailing list