mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-15 12:50:06 +01:00
Fix inline format data device
The data device from parameters was not applied properly for inline HW tags device. The luksFormat then fails if --header is used.
This commit is contained in:
11
lib/setup.c
11
lib/setup.c
@@ -3026,6 +3026,17 @@ int crypt_format_inline(struct crypt_device *cd,
|
|||||||
} else if (isLUKS2(type)) {
|
} else if (isLUKS2(type)) {
|
||||||
lparams = params;
|
lparams = params;
|
||||||
iparams = lparams->integrity_params;
|
iparams = lparams->integrity_params;
|
||||||
|
|
||||||
|
if (lparams->data_device) {
|
||||||
|
if (!cd->metadata_device)
|
||||||
|
cd->metadata_device = cd->device;
|
||||||
|
else
|
||||||
|
device_free(cd, cd->device);
|
||||||
|
cd->device = NULL;
|
||||||
|
if (device_alloc(cd, &cd->device, lparams->data_device) < 0)
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
idevice = crypt_data_device(cd);
|
idevice = crypt_data_device(cd);
|
||||||
required_sector_size = lparams->sector_size;
|
required_sector_size = lparams->sector_size;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user