From: Luis Henriques (SUSE) Date: Tue, 11 Jun 2024 14:27:04 +0000 (+0100) Subject: tests: new test to check that the orphan file is cleaned up X-Git-Tag: v1.47.2-rc1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9448aedd93521deb038f64ba16eff574628f0632;p=thirdparty%2Fe2fsprogs.git tests: new test to check that the orphan file is cleaned up This test verifies that e2fsck clears the orphan file if it is present. The filesystem was created by simply creating a bunch of empty files and, while those files were open by an application, delete some of them in order to add them to the orphan file. After this, the filesystem is simply powered off. An e2fsck will need to clear the orphaned inodes but also to clean the orphan file. Signed-off-by: Luis Henriques (SUSE) Link: https://lore.kernel.org/r/20240611142704.14307-3-luis.henriques@linux.dev Signed-off-by: Theodore Ts'o --- diff --git a/tests/f_clear_orphan_file/expect.1 b/tests/f_clear_orphan_file/expect.1 new file mode 100644 index 00000000..281b131c --- /dev/null +++ b/tests/f_clear_orphan_file/expect.1 @@ -0,0 +1,35 @@ +test_filesys: recovering journal +Clearing orphaned inode 13 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 14 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 15 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 16 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 17 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 18 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 19 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 20 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 21 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 22 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 23 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 24 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 25 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 26 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 27 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 28 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 29 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 30 (uid=0, gid=0, mode=0100644, size=0) +Clearing orphaned inode 31 (uid=0, gid=0, mode=0100644, size=0) +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Free inodes count wrong (2055, counted=2005). +Fix? yes + +Orphan file (inode 12) block 0 is not clean. +Clear? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 43/2048 files (2.3% non-contiguous), 1650/8192 blocks +Exit status is 1 diff --git a/tests/f_clear_orphan_file/expect.2 b/tests/f_clear_orphan_file/expect.2 new file mode 100644 index 00000000..f719dbba --- /dev/null +++ b/tests/f_clear_orphan_file/expect.2 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 43/2048 files (2.3% non-contiguous), 1650/8192 blocks +Exit status is 0 diff --git a/tests/f_clear_orphan_file/image.gz b/tests/f_clear_orphan_file/image.gz new file mode 100644 index 00000000..c93cf754 Binary files /dev/null and b/tests/f_clear_orphan_file/image.gz differ diff --git a/tests/f_clear_orphan_file/name b/tests/f_clear_orphan_file/name new file mode 100644 index 00000000..89ba2247 --- /dev/null +++ b/tests/f_clear_orphan_file/name @@ -0,0 +1 @@ +clear orphan file diff --git a/tests/f_clear_orphan_file/script b/tests/f_clear_orphan_file/script new file mode 100644 index 00000000..2210e9dd --- /dev/null +++ b/tests/f_clear_orphan_file/script @@ -0,0 +1,2 @@ +FSCK_OPT=-y +. $cmd_dir/run_e2fsck