[dm-devel] Patch "dm-crypt: provide dma_alignment limit in io_hints" has been added to the 6.0-stable tree

Sasha Levin sashal at kernel.org
Mon Nov 21 05:09:01 UTC 2022


This is a note to let you know that I've just added the patch titled

    dm-crypt: provide dma_alignment limit in io_hints

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     dm-crypt-provide-dma_alignment-limit-in-io_hints.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable at vger.kernel.org> know about it.



commit e6bb09b02e87cbde45c6d2692fb710579a08c366
Author: Keith Busch <kbusch at kernel.org>
Date:   Thu Nov 10 10:44:58 2022 -0800

    dm-crypt: provide dma_alignment limit in io_hints
    
    [ Upstream commit 86e4d3e8d1838ca88fb9267e669c36f6c8f7c6cd ]
    
    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: b1a000d3b8ec5 ("block: relax direct io memory alignment")
    Reportred-by: Eric Biggers <ebiggers at kernel.org>
    Reported-by: Dmitrii Tcvetkov <me at demsh.org>
    Signed-off-by: Keith Busch <kbusch at kernel.org>
    Reviewed-by: Mike Snitzer <snitzer at kernel.org>
    Link: https://lore.kernel.org/r/20221110184501.2451620-3-kbusch@meta.com
    Signed-off-by: Jens Axboe <axboe at kernel.dk>
    Signed-off-by: Sasha Levin <sashal at kernel.org>

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 = {



More information about the dm-devel mailing list