SHA256
1
0
forked from pool/cryptsetup
cryptsetup/cryptsetup-1.0.5-run_udevsettle.patch

29 lines
696 B
Diff
Raw Normal View History

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: