From 02a48caf7e1af1be417311498dd2f6c1de3883df Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Thu, 15 May 2025 15:49:28 +0200 Subject: [PATCH] Print better error message for unsupported LUKS2 AEAD device resize. Fixes: #804 --- lib/setup.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/setup.c b/lib/setup.c index d75f6b50..26277a6a 100644 --- a/lib/setup.c +++ b/lib/setup.c @@ -3709,6 +3709,11 @@ int crypt_resize(struct crypt_device *cd, const char *name, uint64_t new_size) return -EINVAL; } + if (isLUKS2(cd->type) && crypt_get_integrity_tag_size(cd)) { + log_err(cd, _("Resize of LUKS2 device with integrity protection is not supported.")); + return -ENOTSUP; + } + if (new_size) log_dbg(cd, "Resizing device %s to %" PRIu64 " sectors.", name, new_size); else