mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 11:50:10 +01:00
Move error message for a keyslot area search.
This commit is contained in:
@@ -97,7 +97,7 @@ int LUKS2_find_area_gap(struct crypt_device *cd, struct luks2_hdr *hdr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((offset + length) > get_max_offset(hdr)) {
|
if ((offset + length) > get_max_offset(hdr)) {
|
||||||
log_err(cd, _("No space for new keyslot."));
|
log_dbg(cd, "Not enough space in header keyslot area.");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -480,8 +480,10 @@ static int luks2_keyslot_alloc(struct crypt_device *cd,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
r = LUKS2_find_area_gap(cd, hdr, volume_key_len, &area_offset, &area_length);
|
r = LUKS2_find_area_gap(cd, hdr, volume_key_len, &area_offset, &area_length);
|
||||||
if (r < 0)
|
if (r < 0) {
|
||||||
|
log_err(cd, _("No space for new keyslot."));
|
||||||
return r;
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
jobj_keyslot = json_object_new_object();
|
jobj_keyslot = json_object_new_object();
|
||||||
json_object_object_add(jobj_keyslot, "type", json_object_new_string("luks2"));
|
json_object_object_add(jobj_keyslot, "type", json_object_new_string("luks2"));
|
||||||
|
|||||||
Reference in New Issue
Block a user