Move error message for a keyslot area search.

This commit is contained in:
Milan Broz
2019-03-13 14:45:44 +01:00
parent d5f71e66f9
commit 751f5dfda3
2 changed files with 4 additions and 2 deletions

View File

@@ -97,7 +97,7 @@ int LUKS2_find_area_gap(struct crypt_device *cd, struct luks2_hdr *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;
}

View File

@@ -480,8 +480,10 @@ static int luks2_keyslot_alloc(struct crypt_device *cd,
return -EINVAL;
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;
}
jobj_keyslot = json_object_new_object();
json_object_object_add(jobj_keyslot, "type", json_object_new_string("luks2"));