All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>, Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	Damien Le Moal <damien.lemoal@wdc.com>
Cc: linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: [PATCH 3/4] btrfs: use bio_is_zone_append in the completion handler
Date: Fri,  1 Nov 2024 06:21:46 +0100	[thread overview]
Message-ID: <20241101052206.437530-4-hch@lst.de> (raw)
In-Reply-To: <20241101052206.437530-1-hch@lst.de>

Otherwise it won't catch bios turned into regular writes by the
block level zone write plugging.

Fixes: 9b1ce7f0c6f8 ("block: Implement zone append emulation")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/btrfs/bio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c
index fec5c6cde0a7..0f096e226908 100644
--- a/fs/btrfs/bio.c
+++ b/fs/btrfs/bio.c
@@ -366,7 +366,7 @@ static void btrfs_simple_end_io(struct bio *bio)
 		INIT_WORK(&bbio->end_io_work, btrfs_end_bio_work);
 		queue_work(btrfs_end_io_wq(fs_info, bio), &bbio->end_io_work);
 	} else {
-		if (bio_op(bio) == REQ_OP_ZONE_APPEND && !bio->bi_status)
+		if (bio_is_zone_append(bio) && !bio->bi_status)
 			btrfs_record_physical_zoned(bbio);
 		btrfs_bio_end_io(bbio, bbio->bio.bi_status);
 	}
@@ -409,7 +409,7 @@ static void btrfs_orig_write_end_io(struct bio *bio)
 	else
 		bio->bi_status = BLK_STS_OK;
 
-	if (bio_op(bio) == REQ_OP_ZONE_APPEND && !bio->bi_status)
+	if (bio_is_zone_append(bio) && !bio->bi_status)
 		stripe->physical = bio->bi_iter.bi_sector << SECTOR_SHIFT;
 
 	btrfs_bio_end_io(bbio, bbio->bio.bi_status);
@@ -423,7 +423,7 @@ static void btrfs_clone_write_end_io(struct bio *bio)
 	if (bio->bi_status) {
 		atomic_inc(&stripe->bioc->error);
 		btrfs_log_dev_io_error(bio, stripe->dev);
-	} else if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
+	} else if (bio_is_zone_append(bio)) {
 		stripe->physical = bio->bi_iter.bi_sector << SECTOR_SHIFT;
 	}
 
-- 
2.45.2


  parent reply	other threads:[~2024-11-01  5:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-01  5:21 fix a few zoned append issues Christoph Hellwig
2024-11-01  5:21 ` [PATCH 1/4] block: fix bio_split_rw_at to take zone_write_granularity into account Christoph Hellwig
2024-11-01  5:34   ` Damien Le Moal
2024-11-01  5:47     ` Christoph Hellwig
2024-11-01  5:21 ` [PATCH 2/4] block: lift bio_is_zone_append to bio.h Christoph Hellwig
2024-11-01  5:37   ` Damien Le Moal
2024-11-01  5:48     ` Christoph Hellwig
2024-11-04 10:44   ` Johannes Thumshirn
2024-11-01  5:21 ` Christoph Hellwig [this message]
2024-11-01  5:38   ` [PATCH 3/4] btrfs: use bio_is_zone_append in the completion handler Damien Le Moal
2024-11-04 10:45   ` Johannes Thumshirn
2024-11-05  6:09   ` Naohiro Aota
2024-11-01  5:21 ` [PATCH 4/4] btrfs: split bios to the fs sector size boundary Christoph Hellwig
2024-11-01  5:40   ` Damien Le Moal
2024-11-04 10:45   ` Johannes Thumshirn
2024-11-05  6:00   ` Naohiro Aota

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=20241101052206.437530-4-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=clm@fb.com \
    --cc=damien.lemoal@wdc.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@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 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.