Skip to content

Commit 6c3864e

Browse files
Christoph Hellwigkdave
authored andcommitted
btrfs: use bio_is_zone_append() in the completion handler
Otherwise it won't catch bios turned into regular writes by the block level zone write plugging. The additional test it adds is for emulated zone append. Fixes: 9b1ce7f ("block: Implement zone append emulation") CC: [email protected] # 6.12 Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent d75d72a commit 6c3864e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/btrfs/bio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static void btrfs_simple_end_io(struct bio *bio)
355355
INIT_WORK(&bbio->end_io_work, btrfs_end_bio_work);
356356
queue_work(btrfs_end_io_wq(fs_info, bio), &bbio->end_io_work);
357357
} else {
358-
if (bio_op(bio) == REQ_OP_ZONE_APPEND && !bio->bi_status)
358+
if (bio_is_zone_append(bio) && !bio->bi_status)
359359
btrfs_record_physical_zoned(bbio);
360360
btrfs_bio_end_io(bbio, bbio->bio.bi_status);
361361
}
@@ -398,7 +398,7 @@ static void btrfs_orig_write_end_io(struct bio *bio)
398398
else
399399
bio->bi_status = BLK_STS_OK;
400400

401-
if (bio_op(bio) == REQ_OP_ZONE_APPEND && !bio->bi_status)
401+
if (bio_is_zone_append(bio) && !bio->bi_status)
402402
stripe->physical = bio->bi_iter.bi_sector << SECTOR_SHIFT;
403403

404404
btrfs_bio_end_io(bbio, bbio->bio.bi_status);
@@ -412,7 +412,7 @@ static void btrfs_clone_write_end_io(struct bio *bio)
412412
if (bio->bi_status) {
413413
atomic_inc(&stripe->bioc->error);
414414
btrfs_log_dev_io_error(bio, stripe->dev);
415-
} else if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
415+
} else if (bio_is_zone_append(bio)) {
416416
stripe->physical = bio->bi_iter.bi_sector << SECTOR_SHIFT;
417417
}
418418

0 commit comments

Comments
 (0)