On 6/25/25 2:33 AM, Damien Le Moal wrote:
REQ_OP_ZONE_FINISH is defined as "12", which makes
op_is_write(REQ_OP_ZONE_FINISH) return false, despite the fact that a
zone finish operation is an operation that modifies a zone (transition
it to full) and so should be considered as a write operation (albeit
one that does not transfer any data to the device).

Fix this by redefining REQ_OP_ZONE_FINISH to be an odd number (13), and
redefine REQ_OP_ZONE_RESET and REQ_OP_ZONE_RESET_ALL using sequential
odd numbers from that new value.

Fixes: 6c1b1da58f8c ("block: add zone open, close and finish operations")
Cc: sta...@vger.kernel.org
Signed-off-by: Damien Le Moal <dlem...@kernel.org>
---
  include/linux/blk_types.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 3d1577f07c1c..930daff207df 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -350,11 +350,11 @@ enum req_op {
        /* Close a zone */
        REQ_OP_ZONE_CLOSE       = (__force blk_opf_t)11,
        /* Transition a zone to full */
-       REQ_OP_ZONE_FINISH      = (__force blk_opf_t)12,
+       REQ_OP_ZONE_FINISH      = (__force blk_opf_t)13,
        /* reset a zone write pointer */
-       REQ_OP_ZONE_RESET       = (__force blk_opf_t)13,
+       REQ_OP_ZONE_RESET       = (__force blk_opf_t)15,
        /* reset all the zone present on the device */
-       REQ_OP_ZONE_RESET_ALL   = (__force blk_opf_t)15,
+       REQ_OP_ZONE_RESET_ALL   = (__force blk_opf_t)17,
/* Driver private requests */
        REQ_OP_DRV_IN           = (__force blk_opf_t)34,

Reviewed-by: Bart Van Assche <bvanass...@acm.org>

Reply via email to