Linux block layer
 help / color / mirror / Atom feed
* [PATCH] block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion
@ 2025-06-11  0:59 Damien Le Moal
  2025-06-11  3:27 ` Christoph Hellwig
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Damien Le Moal @ 2025-06-11  0:59 UTC (permalink / raw)
  To: Jens Axboe, linux-block

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")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 block/blk-zoned.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index dfcef04ea8b4..55e64ca869d7 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -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);
 	}
 
 	/*
-- 
2.49.0


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

* Re: [PATCH] block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion
  2025-06-11  0:59 [PATCH] block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion Damien Le Moal
@ 2025-06-11  3:27 ` Christoph Hellwig
  2025-06-11  8:28 ` Hannes Reinecke
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2025-06-11  3:27 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: Jens Axboe, linux-block

On Wed, Jun 11, 2025 at 09:59:15AM +0900, Damien Le Moal wrote:
> 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: Christoph Hellwig <hch@lst.de>


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

* Re: [PATCH] block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion
  2025-06-11  0:59 [PATCH] block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion Damien Le Moal
  2025-06-11  3:27 ` Christoph Hellwig
@ 2025-06-11  8:28 ` Hannes Reinecke
  2025-06-11 10:16 ` Johannes Thumshirn
  2025-06-11 12:43 ` Jens Axboe
  3 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2025-06-11  8:28 UTC (permalink / raw)
  To: Damien Le Moal, Jens Axboe, linux-block

On 6/11/25 02:59, Damien Le Moal wrote:
> 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")
> Cc: stable@vger.kernel.org
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> ---
>   block/blk-zoned.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/block/blk-zoned.c b/block/blk-zoned.c
> index dfcef04ea8b4..55e64ca869d7 100644
> --- a/block/blk-zoned.c
> +++ b/block/blk-zoned.c
> @@ -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);
>   	}
>   
>   	/*
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +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

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

* Re: [PATCH] block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion
  2025-06-11  0:59 [PATCH] block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion Damien Le Moal
  2025-06-11  3:27 ` Christoph Hellwig
  2025-06-11  8:28 ` Hannes Reinecke
@ 2025-06-11 10:16 ` Johannes Thumshirn
  2025-06-11 12:43 ` Jens Axboe
  3 siblings, 0 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2025-06-11 10:16 UTC (permalink / raw)
  To: Damien Le Moal, Jens Axboe, linux-block@vger.kernel.org

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH] block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion
  2025-06-11  0:59 [PATCH] block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion Damien Le Moal
                   ` (2 preceding siblings ...)
  2025-06-11 10:16 ` Johannes Thumshirn
@ 2025-06-11 12:43 ` Jens Axboe
  3 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2025-06-11 12:43 UTC (permalink / raw)
  To: linux-block, Damien Le Moal


On Wed, 11 Jun 2025 09:59:15 +0900, Damien Le Moal wrote:
> 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,
-- 
Jens Axboe




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

end of thread, other threads:[~2025-06-11 12:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-11  0:59 [PATCH] block: Clear BIO_EMULATES_ZONE_APPEND flag on BIO completion Damien Le Moal
2025-06-11  3:27 ` Christoph Hellwig
2025-06-11  8:28 ` Hannes Reinecke
2025-06-11 10:16 ` Johannes Thumshirn
2025-06-11 12:43 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox