From: Lennart Poettering Date: Mon, 17 Aug 2020 20:09:04 +0000 (+0200) Subject: homework: explicitly close cryptsetup context, to not keep loopback device busy X-Git-Tag: v247-rc1~410^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df14bda2b5de8ea022a915774c5a4e4660e421b6;p=thirdparty%2Fsystemd.git homework: explicitly close cryptsetup context, to not keep loopback device busy The cryptsetup context pins the loop device even after deactivation. Let's explicitly release the context to make sure the subsequent loopback device detaching works cleanly. --- diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c index fea00091f62..d97fcbe07a4 100644 --- a/src/home/homework-luks.c +++ b/src/home/homework-luks.c @@ -2166,6 +2166,9 @@ int home_create_luks( goto fail; } + crypt_free(cd); + cd = NULL; + dm_activated = false; loop = loop_device_unref(loop);