Skip to content

Commit 426551f

Browse files
josefbacikkdave
authored andcommitted
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 <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent d792b0f commit 426551f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/btrfs/block-rsv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ void btrfs_update_global_block_rsv(struct btrfs_fs_info *fs_info)
305305
btrfs_space_info_update_bytes_may_use(fs_info, sinfo,
306306
-num_bytes);
307307
block_rsv->reserved = block_rsv->size;
308+
btrfs_try_granting_tickets(fs_info, sinfo);
308309
}
309310

310311
if (block_rsv->reserved == block_rsv->size)

0 commit comments

Comments
 (0)