Pass device size inside reencryption parameters in sectors.

it was mistake in reencryption API. All other device sizes
related to device mapper devices are always in 512b setctors.
This commit is contained in:
Ondrej Kozina
2019-07-09 12:56:03 +02:00
parent 61dff96474
commit 4a232bc868
2 changed files with 14 additions and 12 deletions

View File

@@ -2547,7 +2547,7 @@ static int action_reencrypt_load(struct crypt_device *cd)
.resilience = opt_resilience_mode,
.hash = opt_resilience_hash,
.max_hotzone_size = opt_hotzone_size,
.device_size = opt_device_size,
.device_size = opt_device_size / SECTOR_SIZE,
.flags = CRYPT_REENCRYPT_RESUME_ONLY
};
@@ -2591,7 +2591,7 @@ static int action_encrypt_luks2(struct crypt_device **cd)
.resilience = opt_resilience_mode,
.hash = opt_resilience_hash,
.max_hotzone_size = opt_hotzone_size,
.device_size = opt_device_size,
.device_size = opt_device_size / SECTOR_SIZE,
.luks2 = &luks2_params,
.flags = CRYPT_REENCRYPT_INITIALIZE_ONLY
};
@@ -2753,7 +2753,7 @@ static int action_decrypt_luks2(struct crypt_device *cd)
.resilience = opt_data_shift ? "datashift" : opt_resilience_mode,
.hash = opt_resilience_hash,
.data_shift = imaxabs(opt_data_shift) / SECTOR_SIZE,
.device_size = opt_device_size,
.device_size = opt_device_size / SECTOR_SIZE,
.max_hotzone_size = opt_hotzone_size,
};
size_t passwordLen;
@@ -2967,7 +2967,7 @@ static int action_reencrypt_luks2(struct crypt_device *cd)
.hash = opt_resilience_hash,
.data_shift = imaxabs(opt_data_shift) / SECTOR_SIZE,
.max_hotzone_size = opt_hotzone_size,
.device_size = opt_device_size,
.device_size = opt_device_size / SECTOR_SIZE,
.luks2 = &luks2_params,
};