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

39 lines
802 B
Diff

From: Matthias Koenig <mkoenig@suse.de>
---
lib/libdevmapper.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/lib/libdevmapper.c b/lib/libdevmapper.c
index 676064a..f18b7a1 100644
--- a/lib/libdevmapper.c
+++ b/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, struct crypt_options *options,
if (dmi.read_only)
options->flags |= CRYPT_FLAG_READONLY;
+ /* run udevsettle to avoid problems with busy dm devices */
+ run_udevsettle();
+
r = 0;
out: