[lvm-devel] [PATCH] libdm: fix races with udev

Peter Rajnoha prajnoha at redhat.com
Thu Sep 19 08:15:42 UTC 2013


On 09/16/2013 09:23 PM, Mikulas Patocka wrote:
> libdm: fix races with udev
> 
> On newer systems (Debian 6 and newer), udev manages nodes in /dev/mapper
> directory. It creates, deletes and renames the nodes according to the
> state of the kernel driver.
> 
> dmsetup tries to manage nodes in /dev/mapper too, so it can race with
> udev. dmsetup checks if the node was created/deleted/renamed with the stat
> syscall, and skips the operation if it was. However, if udev
> creates/deletes/renames the node after the stat syscall and before the
> mknod/unlink/rename syscall, dmsetup reports an error.
> 

These checks are performed after udev is synchronized (the dm_udev_wait call)
and after the udev processing is complete, so we normally shouldn't get into this
problem unless there is some bug in certain version of lvm2/udev rules.

Is this reproducible with upstream code as well or was that with some older version only
that is currently in Debian?

Peter




More information about the lvm-devel mailing list