Commit 248f99ca authored by Ondrej Kozina's avatar Ondrej Kozina Committed by Milan Broz

Data alignment is always 512B sectors count.

parent d2f0773e
......@@ -368,7 +368,7 @@ struct crypt_params_plain {
*/
struct crypt_params_luks1 {
const char *hash; /**< hash used in LUKS header */
size_t data_alignment; /**< data alignment in sectors, data offset is multiple of this */
size_t data_alignment; /**< data area alignment in 512B sectors, data offset is multiple of this */
const char *data_device; /**< detached encrypted data device or @e NULL */
};
......@@ -490,7 +490,7 @@ struct crypt_params_luks2 {
const struct crypt_pbkdf_type *pbkdf; /**< PBKDF (and hash) parameters or @e NULL*/
const char *integrity; /**< integrity algorithm or @e NULL */
const struct crypt_params_integrity *integrity_params; /**< Data integrity parameters or @e NULL*/
size_t data_alignment; /**< data alignment in sectors, data offset is multiple of this */
size_t data_alignment; /**< data area alignment in 512B sectors, data offset is multiple of this */
const char *data_device; /**< detached encrypted data device or @e NULL */
uint32_t sector_size; /**< encryption sector size */
const char *label; /**< header label or @e NULL*/
......
......@@ -1572,9 +1572,9 @@ static int _crypt_format_luks2(struct crypt_device *cd,
cd->device = NULL;
if (device_alloc(&cd->device, params->data_device) < 0)
return -ENOMEM;
required_alignment = params->data_alignment * sector_size;
required_alignment = params->data_alignment * SECTOR_SIZE;
} else if (params && params->data_alignment) {
required_alignment = params->data_alignment * sector_size;
required_alignment = params->data_alignment * SECTOR_SIZE;
} else
device_topology_alignment(cd->device,
&required_alignment,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment