Skip to contentSkip to conversation

block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion

PATCH Applied Damien Le Moal 5 participants 5 messages Jun 11, 2025

Subsystems (2)
lore
Share & tools
lore

Damien Le Moal

author maintainer
#0 lore raw

PATCH 1/1 block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion

When blk_zone_write_plug_bio_endio() is called for a regular write BIO used to emulate a zone append operation, that is, a BIO flagged with BIO_EMULATES_ZONE_APPEND, the BIO operation code is restored to the original REQ_OP_ZONE_APPEND but the BIO_EMULATES_ZONE_APPEND flag is not cleared. Clear it to fully return the BIO to its orginal definition.

Fixes 9b1ce7f0c6f8 ("block: Implement zone append emulation")
---
 block/blk-zoned.c | 1 +
 1 file changed, 1 insertion(+)
block/blk-zoned.c +1 -0
index dfcef04ea8b4..55e64ca869d7 100644
@@ -1254,6 +1254,7 @@ void blk_zone_write_plug_bio_endio(struct bio *bio)
 	if (bio_flagged(bio, BIO_EMULATES_ZONE_APPEND)) {
 		bio->bi_opf &= ~REQ_OP_MASK;
 		bio->bi_opf |= REQ_OP_ZONE_APPEND;
+		bio_clear_flag(bio, BIO_EMULATES_ZONE_APPEND);
 	}
 
 	/*
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Damien Le Moal

When blk_zone_write_plug_bio_endio() is called for a regular write BIO used to emulate a zone append operation, that is, a BIO flagged with BIO_EMULATES_ZONE_APPEND, the BIO operation code is restored to the original REQ_OP_ZONE_APPEND but the BIO_EMULATES_ZONE_APPEND flag is not cleared. Clear it to fully return the BIO to its orginal definition.

Looks good:

Reviewed-by on v1 1/1
#2 lore raw
In reply to Damien Le Moal
Quoted 18 lines · Damien Le Moal

When blk_zone_write_plug_bio_endio() is called for a regular write BIO used to emulate a zone append operation, that is, a BIO flagged with BIO_EMULATES_ZONE_APPEND, the BIO operation code is restored to the original REQ_OP_ZONE_APPEND but the BIO_EMULATES_ZONE_APPEND flag is not cleared. Clear it to fully return the BIO to its orginal definition.

Fixes 9b1ce7f0c6f8 ("block: Implement zone append emulation")
---
  block/blk-zoned.c | 1 +
  1 file changed, 1 insertion(+)
block/blk-zoned.c +0 -0
index dfcef04ea8b4..55e64ca869d7 100644

block/blk-zoned.c void blk_zone_write_plug_bio_endio(struct bio *bio) · line 1260

Quoted 7 lines
block/blk-zoned.c +1 -0
@@ -1254,6 +1254,7 @@ void blk_zone_write_plug_bio_endio(struct bio *bio)
  	if (bio_flagged(bio, BIO_EMULATES_ZONE_APPEND)) {
  		bio->bi_opf &= ~REQ_OP_MASK;
  		bio->bi_opf |= REQ_OP_ZONE_APPEND;
+		bio_clear_flag(bio, BIO_EMULATES_ZONE_APPEND);
  	}
 
  	/*

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
maintainer Applied
#4 lore raw
In reply to Damien Le Moal
Quoted 8 lines · Damien Le Moal

When blk_zone_write_plug_bio_endio() is called for a regular write BIO used to emulate a zone append operation, that is, a BIO flagged with BIO_EMULATES_ZONE_APPEND, the BIO operation code is restored to the original REQ_OP_ZONE_APPEND but the BIO_EMULATES_ZONE_APPEND flag is not cleared. Clear it to fully return the BIO to its orginal definition.

[...]

Applied, thanks!

[1/1] block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion

      commit: f705d33c2f0353039d03e5d6f18f70467d86080e

Best regards,

Signature · 1 line
Jens Axboe