Re: dm-integrity: estimate the size needed for separate integrity device
Milan Broz <[email protected]> Sun, 7 Jun 2026 15:08:41 +0200
| Newsgroups | dev.linux.lists.cryptsetup |
|---|---|
| Message-ID | <[email protected]> |
Hi, On 6/1/26 9:50 AM, Max Gautier wrote: > I'm building a media server where I intend to use RAID10 on top of > dm-integrity (and cryptsetup on top of that, but that's not really > relevant, AFAIK). I plan to put the integrity tags of dm-integrity on my > NVME, to avoid some of the performance penalty. > > But I'm not sure what size each "integrity tags" partition should be, > depending on the data device. Interesting, while we can print information about data size, there is actually no calculation of size in the case of an independent data device. (And even this is post-format, we cannot calculate it in userspace in advance.) The only place for this is actually kernel dm-integrity, but the code is tricky. CC to Mikulas - is there a simple way to calculate this size? Or at least provide userspace with information about the existing meta device size (we send only the meta_device option as part of the mapping table). Actually, integritysetup should check device size before activation... (We have such a calculation for dm-verity for hash and FEC device, but not for dm-integrity.) Milan > > I'm using this blog [1] as the base for the calculation, but I couldn't > find a reference for the calculation in the dm-integrity kernel > documentation, in cryptsetup wiki or in the integritysetup man page. > > Is there a reference for calculating that size ? I'm fine looking at > some code, and it looks like the dm-integrity source[2] has some functions names > which could be helpful, but any pointers would help :) > > Thanks ! > > [1]: https://blog.tty8.org/posts/2025-04-02-moving-dm-integrity-tags-off-the-hdd-to-speed-up-raid.html > [2]: https://codebrowser.dev/linux/linux/drivers/md/dm-integrity.c.html >