btrfs-progs: Fix stack overflow for checking qgroup on tree reloc tree
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Thu, 6 Oct 2016 09:13:32 +0000 (17:13 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Oct 2016 13:02:45 +0000 (15:02 +0200)
commitd94816cbde4c26ccd7b936d58636f50682decc83
treeac8f835f56d072d5ec8d92d49259e81b07a93998
parentc9ec835ae1448e9f6fe5e9bbe29c94b6d8cee4ee
btrfs-progs: Fix stack overflow for checking qgroup on tree reloc tree

For tree reloc tree whose level is >= 2, the root node's parent will
point to itself.
In this case it will make btrfsck overflow its stack and cause segfault.

While for tree reloc tree, it doesn't affect qgroup and kernel can
handle it well.

So add tree reloc tree check for qgroup-verify.c and fix the bug.

Test case will follow soon after I make a minimal image for it.
Current xz ziped image is still over 10M for a 512M fs.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
qgroup-verify.c