From: Josef Bacik Date: Fri, 13 Mar 2020 19:58:06 +0000 (-0400) Subject: btrfs: allow to use up to 90% of the global block rsv for unlink X-Git-Tag: v5.8-rc1~182^2~97 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e6549c2aabb9875cf7827bb2283905aaab5b0523;p=linux-platform-drivers-x86.git btrfs: allow to use up to 90% of the global block rsv for unlink We previously had a limit of stealing 50% of the global reserve for unlink. This was from a time when the global reserve was used for the delayed refs as well. However now those reservations are kept separate, so the global reserve can be depleted much more to allow us to make progress for space restoring operations like unlink. Change the minimum amount of space required to be left in the global reserve to 10%. Reviewed-by: Nikolay Borisov Tested-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index f5ec50e6c48e..3a49112ca0ea 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c @@ -867,7 +867,7 @@ static bool steal_from_global_rsv(struct btrfs_fs_info *fs_info, return false; spin_lock(&global_rsv->lock); - min_bytes = div_factor(global_rsv->size, 5); + min_bytes = div_factor(global_rsv->size, 1); if (global_rsv->reserved < min_bytes + ticket->bytes) { spin_unlock(&global_rsv->lock); return false;