btrfs-progs: test: Add image for quota verify stack overflow

For image with tree reloc tree, if its height is over level 2, the root
node's backref will point to itself.  It's valid for kernel, but quota
verify code can't handle it and cause a infinite call, overflowing the
stack.

Add minimal image to reproduce the bug, as regression test.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
[ minor cleanups in test.sh ]
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2016-10-07 15:23:00 +08:00 committed by David Sterba
parent 9119319ef9
commit 112514568f
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#!/bin/bash
#
# Check whether btrfs check quota verify will cause stack overflow.
# This is caused by lack of handling of tree reloc tree.
# Fixed by patch:
# btrfs-progs: Fix stack overflow for checking qgroup on tree reloc tree
source $TOP/tests/common
check_prereq btrfs
check_image()
{
run_check $TOP/btrfs check "$1"
}
check_all_images "."