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.
This commit is contained in:
Ondrej Kozina
2019-11-28 15:52:16 +01:00
parent 3691add163
commit 83934bdcf3
2 changed files with 3 additions and 3 deletions

View File

@@ -2340,9 +2340,9 @@ int LUKS2_unmet_requirements(struct crypt_device *cd, struct luks2_hdr *hdr, uin
reqs &= ~reqs_mask; reqs &= ~reqs_mask;
if (reqs_reencrypt(reqs) && !quiet) 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) 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 */ /* any remaining unmasked requirement fails the check */
return reqs ? -EINVAL : 0; return reqs ? -EINVAL : 0;

View File

@@ -2531,7 +2531,7 @@ static int reencrypt_load(struct crypt_device *cd, struct luks2_hdr *hdr,
else if (ri == CRYPT_REENCRYPT_CRASH) else if (ri == CRYPT_REENCRYPT_CRASH)
r = reencrypt_load_crashed(cd, hdr, device_size, &tmp); r = reencrypt_load_crashed(cd, hdr, device_size, &tmp);
else if (ri == CRYPT_REENCRYPT_NONE) { 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; return -EINVAL;
} else } else
r = -EINVAL; r = -EINVAL;