summaryrefslogtreecommitdiff
path: root/tests/fsck-tests/036-bad-dev-extents/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fsck-tests/036-bad-dev-extents/test.sh')
-rwxr-xr-xtests/fsck-tests/036-bad-dev-extents/test.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/fsck-tests/036-bad-dev-extents/test.sh b/tests/fsck-tests/036-bad-dev-extents/test.sh
new file mode 100755
index 00000000..88ea0aec
--- /dev/null
+++ b/tests/fsck-tests/036-bad-dev-extents/test.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Due to DUP chunk allocator bugs, we could allocate DUP chunks while its dev
+# extents could exist beyond device boundary.
+# And since all related items (block group, chunk, device used bytes) are all
+# valid, btrfs check won't report any error.
+#
+# This test case contains hand crafted minimal image, to test if btrfs check
+# can detect and report such error.
+
+source "$TEST_TOP/common"
+
+check_prereq btrfs
+
+check_image() {
+ run_mustfail "btrfs check failed to detect invalid dev extents" \
+ "$TOP/btrfs" check "$1"
+}
+
+check_all_images