[pkg-cryptsetup-devel] Bug#601886: Bug#601886: cryptsetup: luksformat leaves the Luks device open

Jonas Meurer jonas at freesources.org
Tue Feb 22 13:22:49 UTC 2011

Hey Milan,

On 19/02/2011 Milan Broz wrote:
> On 02/19/2011 04:48 PM, Jonas Meurer wrote:
> > but i guess that the race condition is between libdevmapper and udev.
> > maybe this is related to the outdated devmapper (+udev rules) in debian?
> > 
> > on irc someone said that cryptsetup (luksClose) should wait for the
> > device to become free in case that udev sync is enabled.
> device-mapper udev rules are constructed such way that after cryptsetup
> operation udev links processing should be finished.
> (iow dmsetup udevcomplete must be the last udev rule which manipulates
> with these links. Debian breaks it by reordering udev rules.)

first the good news: Bastian finally uploaded latest lvm2 and
device-mapper upstream to debian unstable. the udev rules are still
slightly different from upstream, but I believe that they're at least
more common than in the past.

> (There is still race with "watch" udev rule but AFAIK only udisks
> using that - but this is not the case here.)
> Sorry but I cannot help here until Debian maintaner wakes up and updates
> lvm/device-mapper udev rules. The changed Debian udev device-mapper rules
> are not supported by upstream.

now the bad news: i'm still able to reproduce the bug with recent
versions of lvm2 and device-mapper. I even replaced the debian udev
rules by the upstream ones (LVM2.2.02.84/udev) restarted udev, and
unfortunately still was able to reproduce the bugreport. It seems like
now the luksClose error "device is busy" occurs less often than before,
but i'm still able to reproduce it something like 3 out of 10 tries.

> (You can add udevadm settle instead of sleep 1, but all these hacks are
> workarounds which are not needed with upstream.)

i fear that workarounds like this are still needed.

do you have any suggestion what to do about it? i'm really not enough
into udev magic to work on race conditions like this, but i'd at least
like to forward this to the right adress to increase the chance that it
will be fixed once.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-cryptsetup-devel/attachments/20110222/d7c067e6/attachment.pgp>

More information about the pkg-cryptsetup-devel mailing list