On Wed, Mar 18, 2026 at 07:06:40PM +0100, Mikulas Patocka wrote:
> 
> If we have dm-integrity with 512-byte sector size on the top of a device 
> that has dma_alignment less than 512, the code would set 
> limits->dma_alignment to the value of the underlying block device and 
> break dm-integrity (which assumes sector-aligned bios).
> 
> But that's a problem of dm-integrity - this "if (ic->sectors_per_block > 
> 1)" condition in dm_integrity_io_hints is weird, it should be dropped and 
> the limits should be properly merged.

Looks like dm-integrity is a bit weird for other reasons, too. If a user
creates a dm-integrity device with block size of 1k or 2k, but the
backing device is 4k logical size, we'll have a mismatch from what the
dm-integrity block device reports compared to what it can actually do.

The pattern needed to get it right is repeated several times, so a
helper is probably warranted. I'll put a series together as a prep and
fix up.

Reply via email to