summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-10-09 09:28:24 -0400
committerDavid Sterba <dsterba@suse.com>2021-02-08 22:58:58 +0100
commitf205edf77315a33eee82a7615fb57e9297957fe9 (patch)
tree3aa65c653767af52279ead0bf05c80c52ea2b2e0 /fs
parentae7913ba52ec4a2883eb073c6bc99f1a8d9d636b (diff)
btrfs: check reclaim_size in need_preemptive_reclaim
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/space-info.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index effb9b73a418..9f30d6837eb5 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -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;