diff options
author | Josef Bacik <josef@toxicpanda.com> | 2021-12-02 15:34:32 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-01-07 14:18:25 +0100 |
commit | c18e3235646a8ba74d013067a6475c8d262d3776 (patch) | |
tree | 3ac070a24d729c9b6fe262b941a66ee9c431c345 /fs/btrfs/block-rsv.c | |
parent | 9506f9538206acb9a3c24d1ffbd587733b185732 (diff) | |
download | linux-c18e3235646a8ba74d013067a6475c8d262d3776.tar.bz2 |
btrfs: reserve extra space for the free space tree
Filipe reported a problem where sometimes he'd get an ENOSPC abort when
running delayed refs with generic/619 and the free space tree enabled.
This is partly because we do not reserve space for modifying the free
space tree, nor do we have a block rsv associated with that tree.
The delayed_refs_rsv tracks the amount of space required to run delayed
refs. This means 1 modification means 1 change to the extent root.
With the free space tree this turns into 2 changes, because modifying 1
extent means updating the extent tree and potentially updating the free
space tree to either remove that entry or add the free space. Thus if
we have the FST enabled, simply double the reservation size for our
modification.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/block-rsv.c')
-rw-r--r-- | fs/btrfs/block-rsv.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c index b3086f252ad0..b3ee49b0b1e8 100644 --- a/fs/btrfs/block-rsv.c +++ b/fs/btrfs/block-rsv.c @@ -426,6 +426,7 @@ void btrfs_init_root_block_rsv(struct btrfs_root *root) switch (root->root_key.objectid) { case BTRFS_CSUM_TREE_OBJECTID: case BTRFS_EXTENT_TREE_OBJECTID: + case BTRFS_FREE_SPACE_TREE_OBJECTID: root->block_rsv = &fs_info->delayed_refs_rsv; break; case BTRFS_ROOT_TREE_OBJECTID: |