summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/block-group.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-07-21 16:22:17 +0200
committerDavid Sterba <dsterba@suse.com>2020-10-07 12:06:51 +0200
commit3308234a7e9828f8cbec308010348ddf712fc15e (patch)
tree05625728bbd665c4e539b52a5ff43aa28426e4e8 /fs/btrfs/block-group.c
parentbtrfs: make ALLOC_CHUNK use the space info flags (diff)
downloadlinux-3308234a7e9828f8cbec308010348ddf712fc15e.tar.xz
linux-3308234a7e9828f8cbec308010348ddf712fc15e.zip
btrfs: call btrfs_try_granting_tickets when freeing reserved bytes
We were missing a call to btrfs_try_granting_tickets in btrfs_free_reserved_bytes, so add it to handle the case where we're able to satisfy an allocation because we've freed a pending reservation. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Tested-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to '')
-rw-r--r--fs/btrfs/block-group.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index fb507a389f40..bc95f5f963fb 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -2994,6 +2994,8 @@ void btrfs_free_reserved_bytes(struct btrfs_block_group *cache,
if (delalloc)
cache->delalloc_bytes -= num_bytes;
spin_unlock(&cache->lock);
+
+ btrfs_try_granting_tickets(cache->fs_info, space_info);
spin_unlock(&space_info->lock);
}