diff --git a/tests/fsck-tests/049-dir-hard-link/default.img.xz b/tests/fsck-tests/049-dir-hard-link/default.img.xz new file mode 100644 index 00000000..fd9971ac Binary files /dev/null and b/tests/fsck-tests/049-dir-hard-link/default.img.xz differ diff --git a/tests/fsck-tests/049-dir-hard-link/test.sh b/tests/fsck-tests/049-dir-hard-link/test.sh new file mode 100755 index 00000000..755cdcac --- /dev/null +++ b/tests/fsck-tests/049-dir-hard-link/test.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Verify that check can detect overlapped dir with 2 links +# +# There is a report that btrfs-check doesn't report dir with 2 links as +# error, and only get caught by tree-checker. +# +# Make sure btrfs check can at least detect such error. + +source "$TEST_TOP/common" + +check_prereq btrfs + +check_image() { + run_mustfail "dir with 2 links not detected" \ + "$TOP/btrfs" check "$1" +} + +check_all_images