Skip to content

Commit 042bdfb

Browse files
morbidrsakdave
authored andcommitted
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 <[email protected]> Signed-off-by: Johannes Thumshirn <[email protected]>
1 parent 1eab35c commit 042bdfb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/btrfs/zoned.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2461,12 +2461,16 @@ void btrfs_zone_finish_endio(struct btrfs_fs_info *fs_info, u64 logical, u64 len
24612461

24622462
static void btrfs_zone_finish_endio_workfn(struct work_struct *work)
24632463
{
2464+
int ret;
24642465
struct btrfs_block_group *bg =
24652466
container_of(work, struct btrfs_block_group, zone_finish_work);
24662467

24672468
wait_on_extent_buffer_writeback(bg->last_eb);
24682469
free_extent_buffer(bg->last_eb);
2469-
btrfs_zone_finish_endio(bg->fs_info, bg->start, bg->length);
2470+
ret = do_zone_finish(bg, true);
2471+
if (ret)
2472+
btrfs_handle_fs_error(bg->fs_info, ret,
2473+
"Failed to finish block-group's zone");
24702474
btrfs_put_block_group(bg);
24712475
}
24722476

0 commit comments

Comments
 (0)