Commit 86e4d3e8 authored by Keith Busch's avatar Keith Busch Committed by Jens Axboe

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: b1a000d3 ("block: relax direct io memory alignment")
Reportred-by: default avatarEric Biggers <ebiggers@kernel.org>
Reported-by: default avatarDmitrii Tcvetkov <me@demsh.org>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
Reviewed-by: default avatarMike Snitzer <snitzer@kernel.org>
Link: https://lore.kernel.org/r/20221110184501.2451620-3-kbusch@meta.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent c964d62f
......@@ -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 = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment