mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-06 09:57:55 +00:00
Btrfs-progs: return immediately on tree search failure
If the chunk tree search failed in volumes.c:btrfs_read_chunk_tree() return immediately, rather than looping and use the invalid contents of the path structure, causing weird errors/crash at run time. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
1c1725a07b
commit
02e778b278
@ -1717,6 +1717,8 @@ int btrfs_read_chunk_tree(struct btrfs_root *root)
|
|||||||
key.offset = 0;
|
key.offset = 0;
|
||||||
key.type = 0;
|
key.type = 0;
|
||||||
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
|
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
|
||||||
|
if (ret < 0)
|
||||||
|
goto error;
|
||||||
while(1) {
|
while(1) {
|
||||||
leaf = path->nodes[0];
|
leaf = path->nodes[0];
|
||||||
slot = path->slots[0];
|
slot = path->slots[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user