@@ -2392,6 +2392,9 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
sinfo = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_METADATA);
ASSERT(sinfo);
+ if (btrfs_fs_incompat(fs_info, EXTENT_TREE_V2))
+ goto alloc;
+
ins.objectid = node->bytenr;
if (skinny_metadata) {
ins.offset = ref->level;
@@ -2445,11 +2448,12 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
btrfs_mark_buffer_dirty(leaf);
btrfs_free_path(path);
- ret = remove_from_free_space_tree(trans, ins.objectid, fs_info->nodesize);
+alloc:
+ ret = remove_from_free_space_tree(trans, node->bytenr, fs_info->nodesize);
if (ret)
return ret;
- ret = update_block_group(trans, ins.objectid, fs_info->nodesize, 1, 0);
+ ret = update_block_group(trans, node->bytenr, fs_info->nodesize, 1, 0);
if (sinfo) {
if (fs_info->nodesize > sinfo->bytes_reserved) {
WARN_ON(1);
For extent tree v2 we are no longer tracking metadata blocks in the extent tree, so simply skip this step and remove the space from the free space tree and do the block group accounting. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- kernel-shared/extent-tree.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)