mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 20:00:08 +01:00
Do not create excessively large headers.
When creating LUKS2 header with specified --offset much larger then LUKS2 header size we needlessly also wipe (allocate up to --offset) much larger file than needed.
This commit is contained in:
committed by
Milan Broz
parent
ac535923e0
commit
a15008d876
@@ -1874,7 +1874,7 @@ static int _crypt_format_luks2(struct crypt_device *cd,
|
||||
goto out;
|
||||
}
|
||||
|
||||
r = LUKS2_wipe_header_areas(cd, &cd->u.luks2.hdr);
|
||||
r = LUKS2_wipe_header_areas(cd, &cd->u.luks2.hdr, cd->metadata_device != NULL);
|
||||
if (r < 0) {
|
||||
log_err(cd, _("Cannot wipe header on device %s."),
|
||||
mdata_device_path(cd));
|
||||
|
||||
Reference in New Issue
Block a user