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 via email to