Re: Re: Failed to write to key storage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thomas Bächler <thomas@xxxxxxxxxxxxx> writes:

> Alasdair G Kergon schrieb:
>>> ioctl(3, DM_DEV_REMOVE, 0x564ae0)       = -1 EBUSY (Device or resource busy)
>> 
>> If you don't see that when the command works, find out what still has the
>> device open.  (e.g. dmsetup info -c output, lsof, try turning udev off)
>
> I can see those randomly, no matter if the command does or doesn't work.
> It leaves an unused temporary-cryptsetup-XXXXX device behind in these cases.

This likely an udev issue. We also observed this, see 
https://bugzilla.novell.com/show_bug.cgi?id=285478
The patch below might fix the problem, by running udevsettle after dm device
creation.

Matthias

Index: cryptsetup-1.0.5/lib/libdevmapper.c
===================================================================
--- cryptsetup-1.0.5.orig/lib/libdevmapper.c
+++ cryptsetup-1.0.5/lib/libdevmapper.c
@@ -18,6 +18,13 @@
 
 #define	CRYPT_TARGET	"crypt"
 
+#define UDEVSETTLE	"/sbin/udevsettle"
+
+static void run_udevsettle(void)
+{
+	system(UDEVSETTLE);
+}
+
 static void set_dm_error(int level, const char *file, int line,
                          const char *f, ...)
 {
@@ -184,6 +191,9 @@ static int dm_create_device(int reload, 
 	if (dmi.read_only)
 		options->flags |= CRYPT_FLAG_READONLY;
 
+	/* run udevsettle to avoid problems with busy dm devices */
+	run_udevsettle();
+
 	r = 0;
 	
 out:

---------------------------------------------------------------------
dm-crypt mailing list - http://www.saout.de/misc/dm-crypt/
To unsubscribe, e-mail: dm-crypt-unsubscribe@xxxxxxxx
For additional commands, e-mail: dm-crypt-help@xxxxxxxx

[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux