From 83934bdcf3fc46280a38d48567b0adddf0233d5f Mon Sep 17 00:00:00 2001 From: Ondrej Kozina Date: Thu, 28 Nov 2019 15:52:16 +0100 Subject: [PATCH] Clarify LUKS2 error message related to reencryption. Original messages could evoke reencryption is currently in progress. That was inaccurate because code only detected flag marking such device is in transition state from metadata pov. We should not imply anything about running processes. That's detected via reencryption locks. --- lib/luks2/luks2_json_metadata.c | 4 ++-- lib/luks2/luks2_reencrypt.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/luks2/luks2_json_metadata.c b/lib/luks2/luks2_json_metadata.c index 51b18346..4e38a596 100644 --- a/lib/luks2/luks2_json_metadata.c +++ b/lib/luks2/luks2_json_metadata.c @@ -2340,9 +2340,9 @@ int LUKS2_unmet_requirements(struct crypt_device *cd, struct luks2_hdr *hdr, uin reqs &= ~reqs_mask; if (reqs_reencrypt(reqs) && !quiet) - log_err(cd, _("Offline reencryption in progress. Aborting.")); + log_err(cd, _("Operation incompatible with device marked for legacy reencryption. Aborting.")); if (reqs_reencrypt_online(reqs) && !quiet) - log_err(cd, _("Online reencryption in progress. Aborting.")); + log_err(cd, _("Operation incompatible with device marked for LUKS2 reencryption. Aborting.")); /* any remaining unmasked requirement fails the check */ return reqs ? -EINVAL : 0; diff --git a/lib/luks2/luks2_reencrypt.c b/lib/luks2/luks2_reencrypt.c index 5edc266c..9cb0b3fc 100644 --- a/lib/luks2/luks2_reencrypt.c +++ b/lib/luks2/luks2_reencrypt.c @@ -2531,7 +2531,7 @@ static int reencrypt_load(struct crypt_device *cd, struct luks2_hdr *hdr, else if (ri == CRYPT_REENCRYPT_CRASH) r = reencrypt_load_crashed(cd, hdr, device_size, &tmp); else if (ri == CRYPT_REENCRYPT_NONE) { - log_err(cd, _("No LUKS2 reencryption in progress.")); + log_err(cd, _("Device not marked for LUKS2 reencryption.")); return -EINVAL; } else r = -EINVAL;