path: root/tests
diff options
authorNikolay Borisov <>2018-03-26 16:59:34 +0300
committerDavid Sterba <>2018-06-07 16:37:33 +0200
commite889fd7c1172ab5ef304dbbf5b003c0331e6ac9d (patch)
tree32f9592e949e97a65fc6cabbfc5b790db5afe305 /tests
parent62b7a389c69460a19978c24b0f217f85b93a0359 (diff)
btrfs-progs: tests: Add test for collision DIR_ITEM handling
Verify that if we have an otherwise clean filesystem, containging collided DIR_ITEM, btrfs check lowmem's mode can correctly handle those and not produce any false positives. This if fixed by commit titled: "btrfs-progs: check: fix DIR_ITEM checking in lowmem" Signed-off-by: Nikolay Borisov <> Reviewed-by: Qu Wenruo <> Signed-off-by: David Sterba <>
Diffstat (limited to 'tests')
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/fsck-tests/033-lowmem-collission-dir-items/ b/tests/fsck-tests/033-lowmem-collission-dir-items/
new file mode 100755
index 00000000..60f34b25
--- /dev/null
+++ b/tests/fsck-tests/033-lowmem-collission-dir-items/
@@ -0,0 +1,24 @@
+# Ensure that running btrfs check on a fs which has name collisions of files
+# doesn't result in false positives. This test is specifically targeted at
+# lowmem mode.
+source "$TEST_TOP/common"
+check_prereq btrfs
+check_prereq mkfs.btrfs
+run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+# Create 2 files whose names collide
+run_check $SUDO_HELPER touch "$TEST_MNT/5ab4e206~~~~~~~~XVT1U3ZF647YS2PD4AKAG826"
+run_check $SUDO_HELPER touch "$TEST_MNT/5ab4e26a~~~~~~~~AP1C3VQBE79IJOTVOEZIR9YU"
+# The fs is clean so lowmem shouldn't produce any warnings
+run_check "$TOP/btrfs" check --readonly "$TEST_DEV"