btrfs: output extra debug info if we failed to find an inline backref
authorQu Wenruo <wqu@suse.com>
Tue, 1 Aug 2023 11:02:28 +0000 (19:02 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Aug 2023 12:54:48 +0000 (14:54 +0200)
commit7f72f50547b7af4ddf985b07fc56600a4deba281
treec340205bef47c2fe3ca9e594e1034a19abb06b88
parent76c5126e76696e61ced5d6e34441f857733741bf
btrfs: output extra debug info if we failed to find an inline backref

[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 <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c