Blame SOURCES/cryptsetup-2.0.4-allow-LUKS2-repair-with-disabled-locks.patch

ac737d
From c6dc8dd86c797b982d47ebb918367b4575d59dad Mon Sep 17 00:00:00 2001
ac737d
From: Ondrej Kozina <okozina@redhat.com>
ac737d
Date: Mon, 9 Jul 2018 18:43:02 +0200
ac737d
Subject: [PATCH 6/6] Allow LUKS2 repair with disabled locks.
ac737d
ac737d
---
ac737d
 lib/luks2/luks2_disk_metadata.c | 3 ++-
ac737d
 1 file changed, 2 insertions(+), 1 deletion(-)
ac737d
ac737d
diff --git a/lib/luks2/luks2_disk_metadata.c b/lib/luks2/luks2_disk_metadata.c
ac737d
index 6ca9d5e..bd5223f 100644
ac737d
--- a/lib/luks2/luks2_disk_metadata.c
ac737d
+++ b/lib/luks2/luks2_disk_metadata.c
ac737d
@@ -592,7 +592,8 @@ int LUKS2_disk_hdr_read(struct crypt_device *cd, struct luks2_hdr *hdr,
ac737d
 	int i, r;
ac737d
 	uint64_t hdr_size;
ac737d
 
ac737d
-	if (do_recovery && !crypt_metadata_locking_enabled()) {
ac737d
+	/* Skip auto-recovery if locks are disabled and we're not doing LUKS2 explicit repair */
ac737d
+	if (do_recovery && do_blkprobe && !crypt_metadata_locking_enabled()) {
ac737d
 		do_recovery = 0;
ac737d
 		log_dbg("Disabling header auto-recovery due to locking being disabled.");
ac737d
 	}
ac737d
-- 
ac737d
1.8.3.1
ac737d