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 patch introduces a new block layer helper function in
preparation for the second patch which forces DM to split zone write
operations to the device limits. The third 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 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 (4):
  block: Introduce bio_needs_zone_write_plugging()
  dm: Always split write BIOs to zoned device limits
  dm: dm-crypt: Do not split write operations with zoned targets
  dm: Check for forbidden splitting of zone write operations

 block/blk-zoned.c      | 40 ++++++++++++++++++++++++++++++++++
 drivers/md/dm-crypt.c  | 49 +++++++++++++++++++++++++++++++++---------
 drivers/md/dm.c        | 45 ++++++++++++++++++++++++++++----------
 include/linux/blkdev.h |  9 ++++++++
 4 files changed, 122 insertions(+), 21 deletions(-)

-- 
2.49.0


Reply via email to