ZONED btrfs uses REQ_OP_ZONE_APPEND for a bio going to actual devices. Let btrfs_end_bio() and btrfs_op, who faces the bios, aware of it. Signed-off-by: Naohiro Aota <naohiro.aota@xxxxxxx> --- fs/btrfs/volumes.c | 3 ++- fs/btrfs/volumes.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index c22ea7f0551f..44ef7b2fb46c 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -6447,7 +6447,8 @@ static void btrfs_end_bio(struct bio *bio) struct btrfs_device *dev = btrfs_io_bio(bio)->device; ASSERT(dev->bdev); - if (bio_op(bio) == REQ_OP_WRITE) + if (bio_op(bio) == REQ_OP_WRITE || + bio_op(bio) == REQ_OP_ZONE_APPEND) btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS); else if (!(bio->bi_opf & REQ_RAHEAD)) diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index c01dd5e40ec8..f8fc3debd5e0 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -410,6 +410,7 @@ static inline enum btrfs_map_op btrfs_op(struct bio *bio) case REQ_OP_DISCARD: return BTRFS_MAP_DISCARD; case REQ_OP_WRITE: + case REQ_OP_ZONE_APPEND: return BTRFS_MAP_WRITE; default: WARN_ON_ONCE(1); -- 2.27.0