From: Christoph Hellwig Date: Wed, 24 May 2023 15:03:05 +0000 (+0200) Subject: btrfs: don't call btrfs_record_physical_zoned for failed append X-Git-Tag: v6.6.7~2168^2~116 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e9cb93b9fbd0bfcef2774e82d095362ad16acf6e;p=platform%2Fkernel%2Flinux-starfive.git btrfs: don't call btrfs_record_physical_zoned for failed append When a zoned append command fails there is no written address reported, so don't try to record it. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index 2e2e1ab..ea6c81f 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -348,7 +348,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) + if (bio_op(bio) == REQ_OP_ZONE_APPEND && !bio->bi_status) btrfs_record_physical_zoned(bbio); btrfs_orig_bbio_end_io(bbio); }