All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@meta.com>
To: <linux-block@vger.kernel.org>, <dm-devel@redhat.com>, <axboe@kernel.dk>
Cc: <stefanha@redhat.com>, <ebiggers@kernel.org>, <me@demsh.org>,
	<mpatocka@redhat.com>, Keith Busch <kbusch@kernel.org>
Subject: [PATCHv2 2/5] dm-crypt: provide dma_alignment limit in io_hints
Date: Thu, 10 Nov 2022 10:44:58 -0800	[thread overview]
Message-ID: <20221110184501.2451620-3-kbusch@meta.com> (raw)
In-Reply-To: <20221110184501.2451620-1-kbusch@meta.com>

From: Keith Busch <kbusch@kernel.org>

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@kernel.org>
Reported-by: Dmitrii Tcvetkov <me@demsh.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/md/dm-crypt.c | 1 +
 1 file changed, 1 insertion(+)

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


WARNING: multiple messages have this Message-ID (diff)
From: Keith Busch <kbusch@meta.com>
To: <linux-block@vger.kernel.org>, <dm-devel@redhat.com>, <axboe@kernel.dk>
Cc: ebiggers@kernel.org, Keith Busch <kbusch@kernel.org>,
	mpatocka@redhat.com, me@demsh.org, stefanha@redhat.com
Subject: [dm-devel] [PATCHv2 2/5] dm-crypt: provide dma_alignment limit in io_hints
Date: Thu, 10 Nov 2022 10:44:58 -0800	[thread overview]
Message-ID: <20221110184501.2451620-3-kbusch@meta.com> (raw)
In-Reply-To: <20221110184501.2451620-1-kbusch@meta.com>

From: Keith Busch <kbusch@kernel.org>

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@kernel.org>
Reported-by: Dmitrii Tcvetkov <me@demsh.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/md/dm-crypt.c | 1 +
 1 file changed, 1 insertion(+)

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

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  parent reply	other threads:[~2022-11-10 18:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 18:44 [PATCHv2 0/5] fix direct io device mapper errors Keith Busch
2022-11-10 18:44 ` [dm-devel] " Keith Busch
2022-11-10 18:44 ` [PATCHv2 1/5] block: make dma_alignment a stacking queue_limit Keith Busch
2022-11-10 18:44   ` [dm-devel] " Keith Busch
2022-11-10 18:44 ` Keith Busch [this message]
2022-11-10 18:44   ` [dm-devel] [PATCHv2 2/5] dm-crypt: provide dma_alignment limit in io_hints Keith Busch
2022-11-16 20:05   ` Mike Snitzer
2022-11-16 20:05     ` Mike Snitzer
2022-11-10 18:44 ` [PATCHv2 3/5] block: make blk_set_default_limits() private Keith Busch
2022-11-10 18:44   ` [dm-devel] " Keith Busch
2022-11-10 18:45 ` [PATCHv2 4/5] dm-integrity: set dma_alignment limit in io_hints Keith Busch
2022-11-10 18:45   ` [dm-devel] " Keith Busch
2022-11-16 20:06   ` Mike Snitzer
2022-11-16 20:06     ` Mike Snitzer
2022-11-10 18:45 ` [PATCHv2 5/5] dm-log-writes: " Keith Busch
2022-11-10 18:45   ` [dm-devel] " Keith Busch
2022-11-16 20:07   ` Mike Snitzer
2022-11-16 20:07     ` Mike Snitzer
2022-11-11 18:07 ` [dm-devel] [PATCHv2 0/5] fix direct io device mapper errors Mike Snitzer
2022-11-11 18:07   ` Mike Snitzer
2022-11-11 18:31   ` Keith Busch
2022-11-11 18:31     ` [dm-devel] " Keith Busch
2022-11-14 11:31     ` Mikulas Patocka
2022-11-14 11:31       ` Mikulas Patocka
2022-11-14 18:12       ` Keith Busch
2022-11-14 18:12         ` [dm-devel] " Keith Busch
2022-11-16 22:58 ` Jens Axboe
2022-11-16 22:58   ` [dm-devel] " Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221110184501.2451620-3-kbusch@meta.com \
    --to=kbusch@meta.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=ebiggers@kernel.org \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=me@demsh.org \
    --cc=mpatocka@redhat.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.