summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/cryptsetup/cryptsetup-1.0.5-run_udevsettle.patch
blob: 28f85e6be7172b2a680349124bbc0088df385b28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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: