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

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