Add a debug message after crypt_load in error path.

This commit is contained in:
Milan Broz
2022-06-17 19:30:35 +02:00
parent c72aecf86d
commit 62a3954c9d

View File

@@ -2882,8 +2882,8 @@ out:
log_err(cd, _("Failed to resume device %s."), name);
device_release_excl(cd, crypt_data_device(cd));
if (r < 0)
crypt_load(cd, CRYPT_LUKS2, NULL);
if (r < 0 && crypt_load(cd, CRYPT_LUKS2, NULL) < 0)
log_dbg(cd, "Cannot reload context after failure.");
return r;
}
@@ -3090,8 +3090,8 @@ static int reencrypt_init(struct crypt_device *cd,
r = reencrypt_keyslot;
out:
device_release_excl(cd, crypt_data_device(cd));
if (r < 0)
crypt_load(cd, CRYPT_LUKS2, NULL);
if (r < 0 && crypt_load(cd, CRYPT_LUKS2, NULL) < 0)
log_dbg(cd, "Cannot reload context after failure.");
return r;
}