From 58b5be440f83afc1598fdce6589b56f1353822a8 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Tue, 19 Nov 2013 20:57:23 +0100 Subject: [PATCH] Fix initialization of unknown used device. dm_query can return open count, this should be processed as success (and properly fail later ;-) --- lib/setup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/setup.c b/lib/setup.c index 2b57fb78..9201be78 100644 --- a/lib/setup.c +++ b/lib/setup.c @@ -721,6 +721,8 @@ static int _init_by_name_crypt(struct crypt_device *cd, const char *name) DM_ACTIVE_CRYPT_KEYSIZE, &dmd); if (r < 0) goto out; + if (r > 0) + r = 0; if (isPLAIN(cd->type)) { cd->u.plain.hdr.hash = NULL; /* no way to get this */ @@ -798,6 +800,8 @@ static int _init_by_name_verity(struct crypt_device *cd, const char *name) DM_ACTIVE_VERITY_PARAMS, &dmd); if (r < 0) goto out; + if (r > 0) + r = 0; if (isVERITY(cd->type)) { cd->u.verity.uuid = NULL; // FIXME