]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use btrfs_try_granting_tickets in update_global_rsv
authorJosef Bacik <josef@toxicpanda.com>
Thu, 22 Aug 2019 19:19:02 +0000 (15:19 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:19 +0000 (14:59 +0200)
commit93d3bbd481a61dba306d3dd24fa42bc778356917
tree3c52f9ce7abd8605e153020a8e415c4754fe830c
parent1afcbdfebfe2a4a6ec526e6a72ed3326a5a2f0f4
btrfs: use btrfs_try_granting_tickets in update_global_rsv

We have some annoying xfstests tests that will create a very small fs,
fill it up, delete it, and repeat to make sure everything works right.
This trips btrfs up sometimes because we may commit a transaction to
free space, but most of the free metadata space was being reserved by
the global reserve.  So we commit and update the global reserve, but the
space is simply added to bytes_may_use directly, instead of trying to
add it to existing tickets.  This results in ENOSPC when we really did
have space.  Fix this by calling btrfs_try_granting_tickets once we add
back our excess space to wake any pending tickets.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-rsv.c