public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	dm-devel@lists.linux.dev, Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH v3 0/5] Fix write operation handling for zoned DM devices
Date: Wed, 25 Jun 2025 18:33:22 +0900	[thread overview]
Message-ID: <20250625093327.548866-1-dlemoal@kernel.org> (raw)

Jens, Mike, Mikulas,

Any zoned DM device using target drivers that internally split BIOs
using dm_accept_partial_bio() can cause deadlocks with concurrent queue
freeze operations. Furthermore, target splitting write operations used
to emulate zone append requests break the emulation. This patch series
addresses both issues by forcing DM to split BIOs to the DM device
limits before passing the BIOs to the target map() function, and by
avoiding calls to dm_accept_partial_bio() for Zoned DM targets that use
zone append emulation.

dm-crypt is the only DM target that is affected by the issue.

The first two patches patch are preparation for the third patch. These
do not intorduce any functional change but are marked as fixes as they
are needed byt the other 3 fix patches.

The third patch forces DM to split zone write operations to the device
limits. The fourth patch removes dm-crypt internal BIO splitting of zone
write operations. The last patch adds checks to dm_accept_partial_bio()
to catch forbidden splits of zone write operations.

Changes from v2:
 - Added patch 1
 - Reworked patch 2 to make the bio_needs_zone_write_plugging() and
   inline function used to drive calls to blk_zone_plug_bio() in blk-mq
   and DM.
 - Adjusted patch 3 to match the changes in patch 2

Changes from v1:
 - Added patch 1 and 2
 - Reworked patch 3 to be more general, that is, to avoid splits of all
   write operations instead of only write operations that are used to
   emulate zone append
 - Modified patch 4 to be consistent with the changes in patch 2 and 3.

Damien Le Moal (5):
  block: Make REQ_OP_ZONE_FINISH a write operation
  block: Introduce bio_needs_zone_write_plugging()
  dm: Always split write BIOs to zoned device limits
  dm: dm-crypt: Do not partially accept write BIOs with zoned targets
  dm: Check for forbidden splitting of zone write operations

 block/blk-mq.c            |  6 +++--
 block/blk-zoned.c         | 20 +-------------
 drivers/md/dm-crypt.c     | 49 +++++++++++++++++++++++++++-------
 drivers/md/dm.c           | 50 ++++++++++++++++++++++++++---------
 include/linux/blk_types.h |  6 ++---
 include/linux/blkdev.h    | 55 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 140 insertions(+), 46 deletions(-)

-- 
2.49.0


             reply	other threads:[~2025-06-25  9:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25  9:33 Damien Le Moal [this message]
2025-06-25  9:33 ` [PATCH v3 1/5] block: Make REQ_OP_ZONE_FINISH a write operation Damien Le Moal
2025-06-25 11:28   ` Christoph Hellwig
2025-06-25 11:42   ` Johannes Thumshirn
2025-06-25 15:44   ` Bart Van Assche
2025-06-25 16:29   ` Bart Van Assche
2025-06-25 23:36     ` Damien Le Moal
2025-06-26 20:29       ` Bart Van Assche
2025-06-25  9:33 ` [PATCH v3 2/5] block: Introduce bio_needs_zone_write_plugging() Damien Le Moal
2025-06-25 11:28   ` Christoph Hellwig
2025-06-25 11:47   ` Johannes Thumshirn
2025-06-25 15:48   ` Bart Van Assche
2025-06-25 23:38     ` Damien Le Moal
2025-06-26 16:37       ` Bart Van Assche
2025-06-25  9:33 ` [PATCH v3 3/5] dm: Always split write BIOs to zoned device limits Damien Le Moal
2025-06-25 11:49   ` Johannes Thumshirn
2025-06-25 16:30   ` Mikulas Patocka
2025-06-25 16:34   ` Bart Van Assche
2025-06-25 23:41     ` Damien Le Moal
2025-06-25  9:33 ` [PATCH v3 4/5] dm: dm-crypt: Do not partially accept write BIOs with zoned targets Damien Le Moal
2025-06-25 16:31   ` Mikulas Patocka
2025-06-25 16:42   ` Bart Van Assche
2025-06-25  9:33 ` [PATCH v3 5/5] dm: Check for forbidden splitting of zone write operations Damien Le Moal
2025-06-25 16:31   ` Mikulas Patocka
2025-06-25 16:37 ` [PATCH v3 0/5] Fix write operation handling for zoned DM devices 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=20250625093327.548866-1-dlemoal@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=dm-devel@lists.linux.dev \
    --cc=linux-block@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox