Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 200a5c17 authored by Jeff Mahoney's avatar Jeff Mahoney Committed by David Sterba
Browse files

btrfs: find_and_setup_root error push-up



find_and_setup_root BUGs when it encounters an error from
btrfs_find_last_root, which can occur if a path can't be allocated.

This patch pushes it up to its callers where it is already handled.

Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
parent 6763af84
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -1197,7 +1197,7 @@ static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
	return 0;
}

static int find_and_setup_root(struct btrfs_root *tree_root,
static int __must_check find_and_setup_root(struct btrfs_root *tree_root,
					    struct btrfs_fs_info *fs_info,
					    u64 objectid,
					    struct btrfs_root *root)
@@ -1213,7 +1213,8 @@ static int find_and_setup_root(struct btrfs_root *tree_root,
				   &root->root_item, &root->root_key);
	if (ret > 0)
		return -ENOENT;
	BUG_ON(ret);
	else if (ret < 0)
		return ret;

	generation = btrfs_root_generation(&root->root_item);
	blocksize = btrfs_level_size(root, btrfs_root_level(&root->root_item));