btrfs: zoned: propagate do_zone_finish() error in btrfs_zone_finish_endio()

btrfs_zone_finish_endio() ignored the return value of do_zone_finish()
and always returned 0, silently dropping a failed zone finish.

Instead propagate any error from do_zone_finish() as the caller
btrfs_finish_ordered_io() already handles it.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Johannes Thumshirn 2026-08-18 12:00:37 +02:00 committed by David Sterba
parent a18a6b93a2
commit c428b763f2

View File

@ -2710,6 +2710,7 @@ int btrfs_zone_finish_endio(struct btrfs_fs_info *fs_info, u64 logical, u64 leng
{
struct btrfs_block_group *block_group;
u64 min_alloc_bytes;
int ret = 0;
if (!btrfs_is_zoned(fs_info))
return 0;
@ -2729,11 +2730,11 @@ int btrfs_zone_finish_endio(struct btrfs_fs_info *fs_info, u64 logical, u64 leng
block_group->start + block_group->zone_capacity)
goto out;
do_zone_finish(block_group, true);
ret = do_zone_finish(block_group, true);
out:
btrfs_put_block_group(block_group);
return 0;
return ret;
}
static void btrfs_zone_finish_endio_workfn(struct work_struct *work)