Skip to content

Commit 86e4d3e

Browse files
keithbuschaxboe
authored andcommitted
dm-crypt: provide dma_alignment limit in io_hints
This device mapper needs bio vectors to be sized and memory aligned to the logical block size. Set the minimum required queue limit accordingly. Link: https://lore.kernel.org/linux-block/[email protected]/ Fixes: b1a000d ("block: relax direct io memory alignment") Reportred-by: Eric Biggers <[email protected]> Reported-by: Dmitrii Tcvetkov <[email protected]> Signed-off-by: Keith Busch <[email protected]> Reviewed-by: Mike Snitzer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent c964d62 commit 86e4d3e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/md/dm-crypt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3630,6 +3630,7 @@ static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits)
36303630
limits->physical_block_size =
36313631
max_t(unsigned, limits->physical_block_size, cc->sector_size);
36323632
limits->io_min = max_t(unsigned, limits->io_min, cc->sector_size);
3633+
limits->dma_alignment = limits->logical_block_size - 1;
36333634
}
36343635

36353636
static struct target_type crypt_target = {

0 commit comments

Comments
 (0)