Linux block layer
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Damien Le Moal <dlemoal@kernel.org>,
	linux-block@vger.kernel.org, io-uring@vger.kernel.org
Subject: [PATCH 3/6] block: remove blk_zone_wplug_handle_zone_mgmt
Date: Thu, 16 Jul 2026 11:17:49 +0200	[thread overview]
Message-ID: <20260716091838.318082-4-hch@lst.de> (raw)
In-Reply-To: <20260716091838.318082-1-hch@lst.de>

blk_zone_wplug_handle_zone_mgmt now only checks that zone reset and
zone finish operations are directed to a sequential write required
zone.  This has nothing to do with zone write plugs and is better
handled with other bio validity checks in submit_bio_noacct.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-core.c  |  9 ++++++++-
 block/blk-zoned.c | 19 -------------------
 2 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 365641266c9e..67cfd7bd8542 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -898,9 +898,16 @@ void submit_bio_noacct(struct bio *bio)
 			goto not_supported;
 		break;
 	case REQ_OP_ZONE_RESET:
+	case REQ_OP_ZONE_FINISH:
+		/*
+		 * Zone reset and zone finish operations do not apply to
+		 * conventional zones.
+		 */
+		if (!bdev_zone_is_seq(bio->bi_bdev, bio->bi_iter.bi_sector))
+			goto end_io;
+		break;
 	case REQ_OP_ZONE_OPEN:
 	case REQ_OP_ZONE_CLOSE:
-	case REQ_OP_ZONE_FINISH:
 	case REQ_OP_ZONE_RESET_ALL:
 		if (!bdev_is_zoned(bio->bi_bdev))
 			goto not_supported;
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 3b7a5f2bdf98..a5afb842bf35 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -1574,21 +1574,6 @@ static void blk_zone_wplug_handle_native_zone_append(struct bio *bio)
 	disk_put_zone_wplug(zwplug);
 }
 
-static bool blk_zone_wplug_handle_zone_mgmt(struct bio *bio)
-{
-	if (bio_op(bio) != REQ_OP_ZONE_RESET_ALL &&
-	    !bdev_zone_is_seq(bio->bi_bdev, bio->bi_iter.bi_sector)) {
-		/*
-		 * Zone reset and zone finish operations do not apply to
-		 * conventional zones.
-		 */
-		bio_io_error(bio);
-		return true;
-	}
-
-	return false;
-}
-
 /**
  * blk_zone_plug_bio - Handle a zone write BIO with zone write plugging
  * @bio: The BIO being submitted
@@ -1635,10 +1620,6 @@ bool blk_zone_plug_bio(struct bio *bio, unsigned int nr_segs)
 	case REQ_OP_WRITE:
 	case REQ_OP_WRITE_ZEROES:
 		return blk_zone_wplug_handle_write(bio, nr_segs);
-	case REQ_OP_ZONE_RESET:
-	case REQ_OP_ZONE_FINISH:
-	case REQ_OP_ZONE_RESET_ALL:
-		return blk_zone_wplug_handle_zone_mgmt(bio);
 	default:
 		return false;
 	}
-- 
2.53.0


  parent reply	other threads:[~2026-07-16  9:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  9:17 add a ZONE_RESET_ALL uring cmd v2 Christoph Hellwig
2026-07-16  9:17 ` [PATCH 1/6] block: remove a dead return statement in blk_zone_plug_bio Christoph Hellwig
2026-07-16 11:26   ` Damien Le Moal
2026-07-16  9:17 ` [PATCH 2/6] block: allow REQ_NOWAIT zone management commands Christoph Hellwig
2026-07-16 11:27   ` Damien Le Moal
2026-07-16  9:17 ` Christoph Hellwig [this message]
2026-07-16 11:28   ` [PATCH 3/6] block: remove blk_zone_wplug_handle_zone_mgmt Damien Le Moal
2026-07-16  9:17 ` [PATCH 4/6] block: also reject zone open / close on conventional zones Christoph Hellwig
2026-07-16 11:29   ` Damien Le Moal
2026-07-16  9:17 ` [PATCH 5/6] block: remove most blkdev_cmd_discard arguments Christoph Hellwig
2026-07-16 11:30   ` Damien Le Moal
2026-07-16  9:17 ` [PATCH 6/6] block: implement async io_uring zone reset all Christoph Hellwig
2026-07-16 11:31   ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260716091838.318082-4-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox