[dm-devel] [PATCH] improve atomicity of device creation

Scott James Remnant scott at ubuntu.com
Tue Dec 11 17:40:28 UTC 2007


On Tue, 2007-12-11 at 18:35 +0100, Kay Sievers wrote:

> On Dec 11, 2007 5:08 PM, Scott James Remnant <scott at ubuntu.com> wrote:
> > This is a patch we've written and applied in Ubuntu to improve the
> > atomicity of devmapper device creation somewhat, and avoid races with
> > udev.
> 
> Without synchronization between libdevmapper and udev, you can't
> predict which one will win in creating the node, right?
> So this patch makes is more likely to create a valid device node, but
> it can still happen, that libdevmapper replaces the udev nodes, which
> is not what we want, right?
> 
No, the patch is slightly skewed so that udev always wins.  udev will
always adopt an existing device node, adjusting permissions as
necessary.  The patch makes devmapper "back off" if the device node
exists.

So you end up with either:

 1) devmapper creates device node
 2) udev adopts device node and sets permissions

or:

 1) udev creates device node and sets permissions
 2) devmapper no-ops since it already exists

Scott
-- 
Scott James Remnant
scott at ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20071211/8be53bd4/attachment.sig>


More information about the dm-devel mailing list