Move wipe debug message and add alignment info.

This commit is contained in:
Milan Broz
2025-05-10 16:11:58 +02:00
parent 5689fb46e7
commit 9484eee48a

View File

@@ -172,6 +172,10 @@ int crypt_wipe_device(struct crypt_device *cd,
/* Note: LUKS1 calls it with wipe_block not aligned to multiple of bsize */
bsize = device_block_size(cd, device);
alignment = device_alignment(device);
log_dbg(cd, "Wipe device %s [%u], offset %" PRIu64 ", length %" PRIu64 ", block %zu, bsize %zu, align %zu.",
device_path(device), (unsigned)pattern, offset, length, wipe_block_size, bsize, alignment);
if (!bsize || !alignment || !wipe_block_size)
return -EINVAL;
@@ -287,9 +291,6 @@ int crypt_wipe(struct crypt_device *cd,
if (!wipe_block_size)
wipe_block_size = 1024*1024;
log_dbg(cd, "Wipe [%u] device %s, offset %" PRIu64 ", length %" PRIu64 ", block %zu.",
(unsigned)pattern, device_path(device), offset, length, wipe_block_size);
r = crypt_wipe_device(cd, device, pattern, offset, length,
wipe_block_size, progress, usrptr);