Re: luks2 + integrity + discard

Milan Broz <[email protected]> Mon, 20 Jul 2026 22:28:27 +0200
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
On 7/20/26 2:16 PM, Piergiorgio Sartor wrote:
> Hello,
> 
> I'm quite puzzled about the, apparently,
> missing support of discard (or trim) in
> case of encryption with integrity.
> 
>  From what I understand, which might be
> very wrong, both the encryption layer
> and dm-integrity should support discard.
> 
> Reading the documentation does not really,
> at least for me, clarify what is the
> reason why it should not be possible to
> have encryption + integrity + discard.
> 
> On the other hand, in case of integrity
> under the raid, with lvm and luks2 on
> top, it seems possible to have discard.
> 
> Can someone provide some clarification
> on this?

Discard (TRIM) is supported for dm-integrity
standalone mode. It is also supported for dm-crypt
standalone.

It is not supported for stacked dm-crypt over dm-integrity
(In authenticated encryption mode where dm-integrity only provides
interleaved metadata sectors for dm-crypt.)
(And it never will be implemented for this case.)

Milan