]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homework: explicitly close cryptsetup context, to not keep loopback device busy
authorLennart Poettering <lennart@poettering.net>
Mon, 17 Aug 2020 20:09:04 +0000 (22:09 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 18 Aug 2020 10:41:26 +0000 (12:41 +0200)
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.

src/home/homework-luks.c

index fea00091f6217b93308fc7b3ad841de898f164b8..d97fcbe07a48ace5b7ce99978c58123dad9cad34 100644 (file)
@@ -2166,6 +2166,9 @@ int home_create_luks(
                 goto fail;
         }
 
+        crypt_free(cd);
+        cd = NULL;
+
         dm_activated = false;
 
         loop = loop_device_unref(loop);