path: root/tests/fsck-tests/023-qgroup-stack-overflow
diff options
authorQu Wenruo <>2016-10-07 15:23:00 +0800
committerDavid Sterba <>2016-10-24 15:03:12 +0200
commit112514568fbe266943d7dd5ed3d2a6a8ab01a1de (patch)
treeb1b801ec48896a267432deff3f120f69bcfa2354 /tests/fsck-tests/023-qgroup-stack-overflow
parent9119319ef99ffd742349f4b91aa8caab02d38fc9 (diff)
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 <> [ minor cleanups in ] Signed-off-by: David Sterba <>
Diffstat (limited to 'tests/fsck-tests/023-qgroup-stack-overflow')
-rw-r--r--tests/fsck-tests/023-qgroup-stack-overflow/quota_balance_loop_backref.raw.xzbin0 -> 55708 bytes
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/fsck-tests/023-qgroup-stack-overflow/quota_balance_loop_backref.raw.xz b/tests/fsck-tests/023-qgroup-stack-overflow/quota_balance_loop_backref.raw.xz
new file mode 100644
index 00000000..a0759739
--- /dev/null
+++ b/tests/fsck-tests/023-qgroup-stack-overflow/quota_balance_loop_backref.raw.xz
Binary files differ
diff --git a/tests/fsck-tests/023-qgroup-stack-overflow/ b/tests/fsck-tests/023-qgroup-stack-overflow/
new file mode 100755
index 00000000..e8bf3fae
--- /dev/null
+++ b/tests/fsck-tests/023-qgroup-stack-overflow/
@@ -0,0 +1,17 @@
+# 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
+ run_check $TOP/btrfs check "$1"
+check_all_images "."