]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
btrfs: only mark bg->needs_free_space if free space tree is on
authorBoris Burkov <boris@bur.io>
Wed, 18 Nov 2020 23:06:18 +0000 (15:06 -0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 9 Dec 2020 18:16:07 +0000 (19:16 +0100)
commit997e3e2e71b32b31bfab6b299d9db05af285b457
tree3e14ab3fe2d7c3d6817fd3d616571603e8240d65
parent8f1c21d7490fc1ac5ef364b7085987ca439fb32f
btrfs: only mark bg->needs_free_space if free space tree is on

If we attempt to create a free space tree while any block groups have
needs_free_space set, we will double add the new free space item
and hit EEXIST. Previously, we only created the free space tree on a new
mount, so we never hit the case, but if we try to create it on a
remount, such block groups could exist and trip us up.

We don't do anything with this field unless the free space tree is
enabled, so there is no harm in not setting it.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c