Skip to content

Fix write operation handling for zoned DM devices

Damien Le Moal dm-devel linux-block 2 versions Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 19 repliesApplied
  2. v24 patches 12 repliesSuperseded

Changes in v3 from the cover letter

- 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

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/5block: Make REQ_OP_ZONE_FINISH a write operationinclude/linux/blk_types.h+3 -36 replies
2/5block: Introduce bio_needs_zone_write_plugging()block/blk-mq.c block/blk-zoned.c drivers/md/dm.c +1 more+63 -225 replies
3/5dm: Always split write BIOs to zoned device limitsdrivers/md/dm.c+22 -74 replies
4/5dm: dm-crypt: Do not partially accept write BIOs with zoned targetsdrivers/md/dm-crypt.c+39 -102 replies
5/5dm: Check for forbidden splitting of zone write operationsdrivers/md/dm.c+13 -41 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchChristoph HellwigJohannes ThumshirnBart Van AsscheMikulas Patocka
1/5R-b R-b R-b
2/5R-b
3/5R-b R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/5] Fix write operation handling for zoned DM devices

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(-)
Signature · 1 line
2.49.0