aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Busch <[email protected]>2022-11-10 10:44:58 -0800
committerJens Axboe <[email protected]>2022-11-16 15:58:11 -0700
commit86e4d3e8d1838ca88fb9267e669c36f6c8f7c6cd (patch)
tree3295393cfa41c74798d8bc0230ff8858f38c5f21
parentc964d62f5cab7b43dd0534f22a96eab386c6ec5d (diff)
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: b1a000d3b8ec5 ("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]>
-rw-r--r--drivers/md/dm-crypt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 159c6806c19b..2653516bcdef 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -3630,6 +3630,7 @@ static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits)
limits->physical_block_size =
max_t(unsigned, limits->physical_block_size, cc->sector_size);
limits->io_min = max_t(unsigned, limits->io_min, cc->sector_size);
+ limits->dma_alignment = limits->logical_block_size - 1;
}
static struct target_type crypt_target = {