btrfs-progs: tests: Add test case with valid orphan inode
authorQu Wenruo <wqu@suse.com>
Mon, 5 Feb 2018 06:47:12 +0000 (14:47 +0800)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Mar 2018 20:15:54 +0000 (22:15 +0200)
Regression test for false alerts in lowmem mode.

Signed-off-by: Qu Wenruo <wqu@suse.com>
[ update test ]
Signed-off-by: David Sterba <dsterba@suse.com>
tests/fsck-tests/029-valid-orphan-item/orphan_inode.img.xz [new file with mode: 0644]
tests/fsck-tests/029-valid-orphan-item/test.sh [new file with mode: 0755]

diff --git a/tests/fsck-tests/029-valid-orphan-item/orphan_inode.img.xz b/tests/fsck-tests/029-valid-orphan-item/orphan_inode.img.xz
new file mode 100644 (file)
index 0000000..26e4cf8
Binary files /dev/null and b/tests/fsck-tests/029-valid-orphan-item/orphan_inode.img.xz differ
diff --git a/tests/fsck-tests/029-valid-orphan-item/test.sh b/tests/fsck-tests/029-valid-orphan-item/test.sh
new file mode 100755 (executable)
index 0000000..d8068f6
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+# To check if btrfs check can handle valid orphan items.
+# Orphan item is a marker for deleted inodes that were open at the time of
+# deletion.  # Orphan inode/root will is not referenced and will have an orphan
+# item, which should not be reported as error.
+
+source "$TEST_TOP/common"
+
+check_prereq btrfs
+
+check_image() {
+       run_check "$TOP/btrfs" check "$1"
+}
+
+check_all_images