All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: Support splitting REQ_OP_ZONE_APPEND bios
@ 2023-03-17 19:50 Bart Van Assche
  2023-03-17 22:39 ` Damien Le Moal
  2023-03-18  6:25 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Bart Van Assche @ 2023-03-17 19:50 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Bart Van Assche, Christoph Hellwig, Keith Busch,
	Damien Le Moal, Josef Bacik, Johannes Thumshirn, David Sterba

Make it easier for filesystems to submit zone append bios that exceed
the block device limits by adding support for REQ_OP_ZONE_APPEND in
bio_split(). See also commit 0512a75b98f8 ("block: Introduce
REQ_OP_ZONE_APPEND").

This patch is a bug fix for commit d5e4377d5051 because that commit
introduces a call to bio_split() for zone append bios without adding
support for splitting REQ_OP_ZONE_APPEND bios in bio_split().

Untested.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>
Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Fixes: d5e4377d5051 ("btrfs: split zone append bios in btrfs_submit_bio")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/bio.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index fc98c1c723ca..8a4805565638 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1631,10 +1631,6 @@ struct bio *bio_split(struct bio *bio, int sectors,
 	BUG_ON(sectors <= 0);
 	BUG_ON(sectors >= bio_sectors(bio));
 
-	/* Zone append commands cannot be split */
-	if (WARN_ON_ONCE(bio_op(bio) == REQ_OP_ZONE_APPEND))
-		return NULL;
-
 	split = bio_alloc_clone(bio->bi_bdev, bio, gfp, bs);
 	if (!split)
 		return NULL;
@@ -1644,7 +1640,8 @@ struct bio *bio_split(struct bio *bio, int sectors,
 	if (bio_integrity(split))
 		bio_integrity_trim(split);
 
-	bio_advance(bio, split->bi_iter.bi_size);
+	if (bio_op(bio) != REQ_OP_ZONE_APPEND)
+		bio_advance(bio, split->bi_iter.bi_size);
 
 	if (bio_flagged(bio, BIO_TRACE_COMPLETION))
 		bio_set_flag(split, BIO_TRACE_COMPLETION);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-20 17:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-17 19:50 [PATCH] block: Support splitting REQ_OP_ZONE_APPEND bios Bart Van Assche
2023-03-17 22:39 ` Damien Le Moal
2023-03-18  0:09   ` Bart Van Assche
2023-03-18  2:21     ` Damien Le Moal
2023-03-20 17:17       ` Bart Van Assche
2023-03-18  6:25 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.