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 0000000000000000000000000000000000000000..48a89ad8fed72766a6cb7720025f60ed0e88ea7a
GIT binary patch
diff --git a/tests/fsck-tests/023-qgroup-stack-overflow/test.sh b/tests/fsck-tests/023-qgroup-stack-overflow/test.sh
new file mode 100644
index 0000000..f49518e
--- /dev/null
+++ b/tests/fsck-tests/023-qgroup-stack-overflow/test.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# check whether btrfsck quota verify will cause stack overflow.
+# this is caused by lack of handle for 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
+
+for img in $(find . \( -iname '*.img' -o	\
+			-iname '*.img.xz' -o 	\
+			-iname '*.raw' -o 	\
+			-iname '*.raw.xz' \) | sort)
+do
+	image=$(extract_image $img)
+	run_check $TOP/btrfs check "$image"
+	rm -f "$image"
+done
