Move checking for detached integrity metadata device.

To allow resizing integrity devices with detached metadata device, the
check has to be moved from _compare_integrity_devices to
_reload_device_with_integrity.
This commit is contained in:
daniel.zatovic
2022-03-02 10:03:16 +01:00
parent 87afb9d783
commit 45b808c186

View File

@@ -2523,10 +2523,6 @@ static int _compare_integrity_devices(struct crypt_device *cd,
return -EINVAL;
}
/* unsupported underneath dm-crypt with auth. encryption */
if (src->u.integrity.meta_device || tgt->u.integrity.meta_device)
return -ENOTSUP;
if (device_is_identical(src->data_device, tgt->data_device) <= 0) {
log_dbg(cd, "Data devices do not match.");
return -EINVAL;
@@ -2703,6 +2699,10 @@ static int _reload_device_with_integrity(struct crypt_device *cd,
goto out;
}
/* unsupported underneath dm-crypt with auth. encryption */
if (sdmdi->segment.u.integrity.meta_device || tdmdi.segment.u.integrity.meta_device)
return -ENOTSUP;
src = &sdmd->segment;
srci = &sdmdi->segment;