All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: Keith Busch <kbusch@meta.com>
Cc: axboe@kernel.dk, ebiggers@kernel.org,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	stefanha@redhat.com, Keith Busch <kbusch@kernel.org>,
	me@demsh.org
Subject: Re: [dm-devel] [PATCH 0/3] fix direct io errors on dm-crypt
Date: Thu, 3 Nov 2022 12:33:19 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LRH.2.21.2211031224060.10758@file01.intranet.prod.int.rdu2.redhat.com> (raw)
In-Reply-To: <20221103152559.1909328-1-kbusch@meta.com>

Hi

The patchset seems OK - but dm-integrity also has a limitation that the 
bio vectors must be aligned on logical block size.

dm-writecache and dm-verity seem to handle unaligned bioset, but you 
should check them anyway.

I'm not sure about dm-log-writes.

Mikulas


On Thu, 3 Nov 2022, Keith Busch wrote:

> From: Keith Busch <kbusch@kernel.org>
> 
> The 6.0 kernel made some changes to the direct io interface to allow
> offsets in user addresses. This based on the hardware's capabilities
> reported in the request_queue's dma_alignment attribute.
> 
> dm-crypt requires direct io be aligned to the block size. Since it was
> only ever using the default 511 dma mask, this requirement may fail if
> formatted to something larger, like 4k, which will result in unexpected
> behavior with direct-io.
> 
> There are two parts to fixing this:
> 
>   First, the attribute needs to be moved to the queue_limit so that it
>   can properly stack with device mappers.
> 
>   Second, dm-crypt provides its minimum required limit to match the
>   logical block size.
> 
> Keith Busch (3):
>   block: make dma_alignment a stacking queue_limit
>   dm-crypt: provide dma_alignment limit in io_hints
>   block: make blk_set_default_limits() private
> 
>  block/blk-core.c       |  1 -
>  block/blk-settings.c   |  9 +++++----
>  block/blk.h            |  1 +
>  drivers/md/dm-crypt.c  |  1 +
>  include/linux/blkdev.h | 16 ++++++++--------
>  5 files changed, 15 insertions(+), 13 deletions(-)
> 
> -- 
> 2.30.2
> 
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


WARNING: multiple messages have this Message-ID (diff)
From: Mikulas Patocka <mpatocka@redhat.com>
To: Keith Busch <kbusch@meta.com>
Cc: linux-block@vger.kernel.org, dm-devel@redhat.com,
	axboe@kernel.dk, stefanha@redhat.com, ebiggers@kernel.org,
	me@demsh.org, Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH 0/3] fix direct io errors on dm-crypt
Date: Thu, 3 Nov 2022 12:33:19 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LRH.2.21.2211031224060.10758@file01.intranet.prod.int.rdu2.redhat.com> (raw)
In-Reply-To: <20221103152559.1909328-1-kbusch@meta.com>

Hi

The patchset seems OK - but dm-integrity also has a limitation that the 
bio vectors must be aligned on logical block size.

dm-writecache and dm-verity seem to handle unaligned bioset, but you 
should check them anyway.

I'm not sure about dm-log-writes.

Mikulas


On Thu, 3 Nov 2022, Keith Busch wrote:

> From: Keith Busch <kbusch@kernel.org>
> 
> The 6.0 kernel made some changes to the direct io interface to allow
> offsets in user addresses. This based on the hardware's capabilities
> reported in the request_queue's dma_alignment attribute.
> 
> dm-crypt requires direct io be aligned to the block size. Since it was
> only ever using the default 511 dma mask, this requirement may fail if
> formatted to something larger, like 4k, which will result in unexpected
> behavior with direct-io.
> 
> There are two parts to fixing this:
> 
>   First, the attribute needs to be moved to the queue_limit so that it
>   can properly stack with device mappers.
> 
>   Second, dm-crypt provides its minimum required limit to match the
>   logical block size.
> 
> Keith Busch (3):
>   block: make dma_alignment a stacking queue_limit
>   dm-crypt: provide dma_alignment limit in io_hints
>   block: make blk_set_default_limits() private
> 
>  block/blk-core.c       |  1 -
>  block/blk-settings.c   |  9 +++++----
>  block/blk.h            |  1 +
>  drivers/md/dm-crypt.c  |  1 +
>  include/linux/blkdev.h | 16 ++++++++--------
>  5 files changed, 15 insertions(+), 13 deletions(-)
> 
> -- 
> 2.30.2
> 


  parent reply	other threads:[~2022-11-03 16:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 15:25 [PATCH 0/3] fix direct io errors on dm-crypt Keith Busch
2022-11-03 15:25 ` [dm-devel] " Keith Busch
2022-11-03 15:25 ` [PATCH 1/3] block: make dma_alignment a stacking queue_limit Keith Busch
2022-11-03 15:25   ` [dm-devel] " Keith Busch
2022-11-04  5:14   ` Christoph Hellwig
2022-11-04  5:14     ` [dm-devel] " Christoph Hellwig
2022-11-03 15:25 ` [PATCH 2/3] dm-crypt: provide dma_alignment limit in io_hints Keith Busch
2022-11-03 15:25   ` [dm-devel] " Keith Busch
2022-11-03 15:25 ` [PATCH 3/3] block: make blk_set_default_limits() private Keith Busch
2022-11-03 15:25   ` [dm-devel] " Keith Busch
2022-11-04  5:15   ` Christoph Hellwig
2022-11-04  5:15     ` [dm-devel] " Christoph Hellwig
2022-11-03 16:33 ` Mikulas Patocka [this message]
2022-11-03 16:33   ` [PATCH 0/3] fix direct io errors on dm-crypt Mikulas Patocka
2022-11-03 20:39   ` Keith Busch
2022-11-03 20:39     ` [dm-devel] " Keith Busch
2022-11-04 13:09     ` Mikulas Patocka
2022-11-04 13:09       ` Mikulas Patocka
2022-11-03 16:41 ` Dmitrii Tcvetkov
2022-11-03 16:41   ` [dm-devel] " Dmitrii Tcvetkov
2022-11-10 18:24 ` Eric Biggers
2022-11-10 18:24   ` [dm-devel] " Eric Biggers
2022-11-10 18:45   ` Keith Busch
2022-11-10 18:45     ` [dm-devel] " Keith Busch

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=alpine.LRH.2.21.2211031224060.10758@file01.intranet.prod.int.rdu2.redhat.com \
    --to=mpatocka@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=ebiggers@kernel.org \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --cc=linux-block@vger.kernel.org \
    --cc=me@demsh.org \
    --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.