aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>2025-07-22 13:39:10 +0200
committerDavid Sterba <dsterba@suse.com>2025-09-22 10:54:30 +0200
commit3d16abf6c88ae20cc4168756e77ad270a9b37182 (patch)
tree001b88c72edf791aac1a1f19b402811958a0cc44 /fs/btrfs
parentbtrfs: collapse unaccount_log_buffer() into clean_log_buffer() (diff)
downloadlinux-3d16abf6c88ae20cc4168756e77ad270a9b37182.tar.gz
linux-3d16abf6c88ae20cc4168756e77ad270a9b37182.zip
btrfs: zoned: directly call do_zone_finish() from btrfs_zone_finish_endio_workfn()
When btrfs_zone_finish_endio_workfn() is calling btrfs_zone_finish_endio() it already has a pointer to the block group. Furthermore btrfs_zone_finish_endio() does additional checks if the block group can be finished or not. But in the context of btrfs_zone_finish_endio_workfn() only the actual call to do_zone_finish() is of interest, as the skipping condition when there is still room to allocate from the block group cannot be checked. Directly call do_zone_finish() on the block group. Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/zoned.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index efc2a81f50e5..c5c4e512a586 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -2488,12 +2488,16 @@ out:
static void btrfs_zone_finish_endio_workfn(struct work_struct *work)
{
+ int ret;
struct btrfs_block_group *bg =
container_of(work, struct btrfs_block_group, zone_finish_work);
wait_on_extent_buffer_writeback(bg->last_eb);
free_extent_buffer(bg->last_eb);
- btrfs_zone_finish_endio(bg->fs_info, bg->start, bg->length);
+ ret = do_zone_finish(bg, true);
+ if (ret)
+ btrfs_handle_fs_error(bg->fs_info, ret,
+ "Failed to finish block-group's zone");
btrfs_put_block_group(bg);
}