Add new internal state marking resilience type as not set.

This commit is contained in:
Ondrej Kozina
2022-06-03 16:17:41 +02:00
parent ee5a7d19c9
commit 98ca9c61d6
2 changed files with 5 additions and 1 deletions

View File

@@ -139,7 +139,8 @@ typedef struct {
} keyslot_handler;
struct reenc_protection {
enum { REENC_PROTECTION_NONE = 0, /* none should be 0 always */
enum { REENC_PROTECTION_NOT_SET = 0,
REENC_PROTECTION_NONE,
REENC_PROTECTION_CHECKSUM,
REENC_PROTECTION_JOURNAL,
REENC_PROTECTION_DATASHIFT } type;

View File

@@ -1229,6 +1229,9 @@ static int reencrypt_hotzone_protect_ready(struct crypt_device *cd,
{
assert(rp);
if (rp->type == REENC_PROTECTION_NOT_SET)
return -EINVAL;
if (rp->type != REENC_PROTECTION_CHECKSUM)
return 0;