mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 20:00:08 +01:00
Add direction hint in reencryption hotzone device name.
This commit is contained in:
committed by
Milan Broz
parent
6851535fe7
commit
2f4a50064f
@@ -2188,7 +2188,7 @@ static bool is_reencryption_helper(const char *name)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
len = strlen(name);
|
len = strlen(name);
|
||||||
return (len >= 9 && (!strcmp(name + len - 8, "-hotzone") ||
|
return (len >= 9 && (!strncmp(name + len - 8, "-hotzone-", 9) ||
|
||||||
!strcmp(name + len - 8, "-overlay")));
|
!strcmp(name + len - 8, "-overlay")));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1184,7 +1184,8 @@ static int LUKS2_reenc_context_set_name(struct luks2_reenc_context *rh, const ch
|
|||||||
|
|
||||||
if (!(rh->device_name = strdup(name)))
|
if (!(rh->device_name = strdup(name)))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
if (asprintf(&rh->hotzone_name, "%s-hotzone", name) < 0) {
|
if (asprintf(&rh->hotzone_name, "%s-hotzone-%s", name,
|
||||||
|
rh->direction == CRYPT_REENCRYPT_FORWARD ? "forward" : "backward") < 0) {
|
||||||
rh->hotzone_name = NULL;
|
rh->hotzone_name = NULL;
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user