]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
btrfs: call btrfs_try_granting_tickets when freeing reserved bytes
authorJosef Bacik <josef@toxicpanda.com>
Tue, 21 Jul 2020 14:22:17 +0000 (10:22 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:06:51 +0000 (12:06 +0200)
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>
fs/btrfs/block-group.c

index fb507a389f40804b0e6123b886fcfc1b477de040..bc95f5f963fb1e37269faa86907e3ff0996d8557 100644 (file)
@@ -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);
 }