mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
Allow disabling of reencryption locks via crypt_metadata_locking()
This commit is contained in:
committed by
Milan Broz
parent
b22c9a86a9
commit
c25ce7c585
@@ -2540,6 +2540,11 @@ int crypt_reencrypt_lock(struct crypt_device *cd, const char *uuid, struct crypt
|
||||
if (strcmp(uuid, tmp))
|
||||
return -EINVAL;
|
||||
|
||||
if (!crypt_metadata_locking_enabled()) {
|
||||
*reencrypt_lock = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = asprintf(&lock_resource, "LUKS2-reencryption-%s", uuid);
|
||||
if (r < 0)
|
||||
return -ENOMEM;
|
||||
@@ -3152,7 +3157,7 @@ int crypt_reencrypt(struct crypt_device *cd,
|
||||
}
|
||||
|
||||
rh = crypt_get_reenc_context(cd);
|
||||
if (!rh || !rh->reenc_lock) {
|
||||
if (!rh || (!rh->reenc_lock && crypt_metadata_locking_enabled())) {
|
||||
log_err(cd, _("Missing or invalid reencrypt context."));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user