Btrfs-progs: fsck: fix wrong check for btrfs_read_fs_root()
When encountering a corrupted fs root node, fsck hit following message:
Check tree block failed, want=
29360128, have=0
Check tree block failed, want=
29360128, have=0
Check tree block failed, want=
29360128, have=0
Check tree block failed, want=
29360128, have=0
Check tree block failed, want=
29360128, have=0
read block failed check_tree_block
Checking filesystem on /dev/sda9
UUID:
0d295d80-bae2-45f2-a106-
120dbfd0e173
checking extents
Segmentation fault (core dumped)
This is because in btrfs_setup_all_roots(), we check
btrfs_read_fs_root() return value by verifing whether it is
NULL pointer, this is wrong since btrfs_read_fs_root() return
PTR_ERR(ret), fix it.
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>