mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-28 09:02:19 +00:00
btrfs-progs: check: orig: Don't panic when unexpected root item is referring to one extent
With crafted image, expected root item can refer to certain extent, and original mode uses BUG_ON() to handle such case. Fix it by gracefully return error. Link: https://bugzilla.kernel.org/show_bug.cgi?id=200403 Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
beb3ede39a
commit
c010437455
@ -3724,7 +3724,12 @@ static int check_owner_ref(struct btrfs_root *root,
|
||||
if (btrfs_header_owner(buf) == back->root)
|
||||
return 0;
|
||||
}
|
||||
BUG_ON(rec->is_root);
|
||||
/*
|
||||
* Some unexpected root item referring to this one, return 1 to
|
||||
* indicate owner not found
|
||||
*/
|
||||
if (rec->is_root)
|
||||
return 1;
|
||||
|
||||
/* try to find the block by search corresponding fs tree */
|
||||
key.objectid = btrfs_header_owner(buf);
|
||||
|
Loading…
Reference in New Issue
Block a user