Skip to content

Commit

Permalink
Btrfs-progs: alloc our super copy in btrfs-find-root
Browse files Browse the repository at this point in the history
Dave fixed the fs_info to allocate the super copy instead of embedding it, but
he failed to notice that I open code open_ctree in btrfs-find-root so we end up
with a super that's not allocated, so we segfault whenever you try to run
btrfs-find-root.  I've fixed this up and now we don't segfault anymore.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
  • Loading branch information
Josef Bacik authored and kdave committed Mar 12, 2013
1 parent 2648a11 commit 016f6f4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions find-root.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ static struct btrfs_root *open_ctree_broken(int fd, const char *device)
}

memset(fs_info, 0, sizeof(*fs_info));
fs_info->super_copy = calloc(1, BTRFS_SUPER_INFO_SIZE);
fs_info->tree_root = tree_root;
fs_info->extent_root = extent_root;
fs_info->chunk_root = chunk_root;
Expand Down

0 comments on commit 016f6f4

Please sign in to comment.