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/20221101001558.648ee024@xps.demsh.org/ Fixes: b1a000d ("block: relax direct io memory alignment") Reportred-by: Eric Biggers <ebiggers@kernel.org> Reported-by: Dmitrii Tcvetkov <me@demsh.org> Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Mike Snitzer <snitzer@kernel.org> Link: https://lore.kernel.org/r/20221110184501.2451620-3-kbusch@meta.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent c964d62 commit 86e4d3e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)