Skip to content

Commit

Permalink
btrfs: check reclaim_size in need_preemptive_reclaim
Browse files Browse the repository at this point in the history
If we're flushing space for tickets then we have
space_info->reclaim_size set and we do not need to do background
reclaim.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Josef Bacik authored and David Sterba committed Feb 8, 2021
1 parent ae7913b commit f205edf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/btrfs/space-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,13 @@ static bool need_preemptive_reclaim(struct btrfs_fs_info *fs_info,
if ((space_info->bytes_used + space_info->bytes_reserved) >= thresh)
return false;

/*
* We have tickets queued, bail so we don't compete with the async
* flushers.
*/
if (space_info->reclaim_size)
return false;

if (!btrfs_calc_reclaim_metadata_size(fs_info, space_info))
return false;

Expand Down

0 comments on commit f205edf

Please sign in to comment.