summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorDamien Le Moal <dlemoal@kernel.org>2025-06-25 18:33:24 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-20 18:30:51 +0200
commit8263f32e1017d88ae75859dca955308c3cd89232 (patch)
tree426a71acd6afaa3b6f33d52f1d17a32f5e0fa70c /drivers/md
parent2214b5de0a93f51d145ff22a98257868790e7abc (diff)
downloadlinux-8263f32e1017d88ae75859dca955308c3cd89232.tar.gz
linux-8263f32e1017d88ae75859dca955308c3cd89232.tar.bz2
linux-8263f32e1017d88ae75859dca955308c3cd89232.zip
block: Introduce bio_needs_zone_write_plugging()
commit f70291411ba20d50008db90a6f0731efac27872c upstream. In preparation for fixing device mapper zone write handling, introduce the inline helper function bio_needs_zone_write_plugging() to test if a BIO requires handling through zone write plugging using the function blk_zone_plug_bio(). This function returns true for any write (op_is_write(bio) == true) operation directed at a zoned block device using zone write plugging, that is, a block device with a disk that has a zone write plug hash table. This helper allows simplifying the check on entry to blk_zone_plug_bio() and used in to protect calls to it for blk-mq devices and DM devices. Fixes: f211268ed1f9 ("dm: Use the block layer zone append emulation") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20250625093327.548866-3-dlemoal@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 92e5a233f516..8079c060e05b 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1800,7 +1800,9 @@ static inline bool dm_zone_bio_needs_split(struct mapped_device *md,
}
static inline bool dm_zone_plug_bio(struct mapped_device *md, struct bio *bio)
{
- return dm_emulate_zone_append(md) && blk_zone_plug_bio(bio, 0);
+ if (!bio_needs_zone_write_plugging(bio))
+ return false;
+ return blk_zone_plug_bio(bio, 0);
}
static blk_status_t __send_zone_reset_all_emulated(struct clone_info *ci,