mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
LUKS2 supports several jsom area length configurations. With the largest size supported in megabytes we do not want to write full metadata area unconditionaly (current code) with every metadata update. This might generate noticeble overhead with LUKS2 reencryption. With this patch we write only the real used json area length plus necessary padding to overwrite remaining previous metadata stored on the disk. During LUKS2 format and LUKS2 autorecovery we always overwrite whole json metadata area no matter the used size.