]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
tests: new test to check that the orphan file is cleaned up
authorLuis Henriques (SUSE) <luis.henriques@linux.dev>
Tue, 11 Jun 2024 14:27:04 +0000 (15:27 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 24 Oct 2024 23:21:22 +0000 (19:21 -0400)
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) <luis.henriques@linux.dev>
Link: https://lore.kernel.org/r/20240611142704.14307-3-luis.henriques@linux.dev
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
tests/f_clear_orphan_file/expect.1 [new file with mode: 0644]
tests/f_clear_orphan_file/expect.2 [new file with mode: 0644]
tests/f_clear_orphan_file/image.gz [new file with mode: 0644]
tests/f_clear_orphan_file/name [new file with mode: 0644]
tests/f_clear_orphan_file/script [new file with mode: 0644]

diff --git a/tests/f_clear_orphan_file/expect.1 b/tests/f_clear_orphan_file/expect.1
new file mode 100644 (file)
index 0000000..281b131
--- /dev/null
@@ -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 (file)
index 0000000..f719dbb
--- /dev/null
@@ -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 (file)
index 0000000..c93cf75
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 (file)
index 0000000..89ba224
--- /dev/null
@@ -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 (file)
index 0000000..2210e9d
--- /dev/null
@@ -0,0 +1,2 @@
+FSCK_OPT=-y
+. $cmd_dir/run_e2fsck