Skip to content

Commit 28062cd

Browse files
adam900710gregkh
authored andcommitted
btrfs: output extra debug info if we failed to find an inline backref
[ Upstream commit 7f72f50 ] [BUG] Syzbot reported several warning triggered inside lookup_inline_extent_backref(). [CAUSE] As usual, the reproducer doesn't reliably trigger locally here, but at least we know the WARN_ON() is triggered when an inline backref can not be found, and it can only be triggered when @insert is true. (I.e. inserting a new inline backref, which means the backref should already exist) [ENHANCEMENT] After the WARN_ON(), dump all the parameters and the extent tree leaf to help debug. Link: https://syzkaller.appspot.com/bug?extid=d6f9ff86c1d804ba2bc6 Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 726deae commit 28062cd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/btrfs/extent-tree.c

+5
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,11 @@ int lookup_inline_extent_backref(struct btrfs_trans_handle *trans,
863863
err = -ENOENT;
864864
goto out;
865865
} else if (WARN_ON(ret)) {
866+
btrfs_print_leaf(path->nodes[0]);
867+
btrfs_err(fs_info,
868+
"extent item not found for insert, bytenr %llu num_bytes %llu parent %llu root_objectid %llu owner %llu offset %llu",
869+
bytenr, num_bytes, parent, root_objectid, owner,
870+
offset);
866871
err = -EIO;
867872
goto out;
868873
}

0 commit comments

Comments
 (0)