aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-find-root.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2013-07-18 00:03:40 +0800
committerDavid Sterba <dsterba@suse.cz>2013-08-09 14:32:37 +0200
commit44aa9dce55b0c35dbdad584c54a72d2525157cc6 (patch)
treeed59bb5520cac43db9ea87da8cd9adfbc93c1b62 /btrfs-find-root.c
parentb3a9a3c94ad254df681d06b0a2be2e41362cce49 (diff)
downloadbtrfs-progs-44aa9dce55b0c35dbdad584c54a72d2525157cc6.tar.gz
btrfs-progs-44aa9dce55b0c35dbdad584c54a72d2525157cc6.tar.xz
btrfs-progs-44aa9dce55b0c35dbdad584c54a72d2525157cc6.zip
Btrfs-progs: fix wrong arg sb_bytenr for btrfs_scan_fs_devices()
For most time, In open_ctree_*(), we use the first superblock (BTRFS_SUPER_INFO_OFFSET). However, for btrfs-convert, we don't, we should pass the correct sb_bytenr to btrfs_scan_fs_devices() rather than always use BTRFS_SUPER_INFO_OFFSET.This patch fix the following regression: mkfs.ext2 <dev> btrfs-convert <dev> warning, device 1 is missing Check tree block failed, want=2670592, have=0 read block failed check_tree_block Couldn't read chunk root Segmentation fault (core dumped) Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'btrfs-find-root.c')
-rw-r--r--btrfs-find-root.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index 989535f..f63789d 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -82,7 +82,7 @@ static struct btrfs_root *open_ctree_broken(int fd, const char *device)
return NULL;
}
- ret = btrfs_scan_fs_devices(fd, device, &fs_devices);
+ ret = btrfs_scan_fs_devices(fd, device, &fs_devices, 0);
if (ret)
goto out;