lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240611142704.14307-3-luis.henriques@linux.dev>
Date: Tue, 11 Jun 2024 15:27:04 +0100
From: "Luis Henriques (SUSE)" <luis.henriques@...ux.dev>
To: Theodore Ts'o <tytso@....edu>,
	Andreas Dilger <adilger@...ger.ca>
Cc: linux-ext4@...r.kernel.org,
	"Luis Henriques (SUSE)" <luis.henriques@...ux.dev>
Subject: [PATCH 2/2] 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) <luis.henriques@...ux.dev>
---
 tests/f_clear_orphan_file/expect.1 |  35 +++++++++++++++++++++++++++++
 tests/f_clear_orphan_file/expect.2 |   7 ++++++
 tests/f_clear_orphan_file/image.gz | Bin 0 -> 12449 bytes
 tests/f_clear_orphan_file/name     |   1 +
 tests/f_clear_orphan_file/script   |   2 ++
 5 files changed, 45 insertions(+)
 create mode 100644 tests/f_clear_orphan_file/expect.1
 create mode 100644 tests/f_clear_orphan_file/expect.2
 create mode 100644 tests/f_clear_orphan_file/image.gz
 create mode 100644 tests/f_clear_orphan_file/name
 create mode 100644 tests/f_clear_orphan_file/script

diff --git a/tests/f_clear_orphan_file/expect.1 b/tests/f_clear_orphan_file/expect.1
new file mode 100644
index 000000000000..281b131cbba0
--- /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 000000000000..f719dbbaad08
--- /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 0000000000000000000000000000000000000000..c93cf754ddbe02dfad966364cc943a3824052cce
GIT binary patch
literal 12449
zcmeH~dsLG7*2imVrqeqWHXWnMl4BQbDsAi{jVWY~nWLszdC3cnrdFg>hKdMJ^EQ)~
zm1U`ww^Gx*Mcxw?rZgE%WxS#xFlk1DhziJ^-%<3RcfD(!f6iaC7W~0_*51!%@...v
z`}chiN&ooAQjfD?Uo1Hn@...SqVb`xAD#@...Ckyrfq*XEpuA>_Qx%+mu8tXU377n
z>~EU74zKD>Ie5&${)l<e(~S@...~X#m%nr~t?u2@...a=GATFr;WyI{w=%YPwz@va
z2AKBCVM4)WuMd|*a#D6Ojt0$4GUZ||rCJ_jlCpH0zvz(EEoIQyWp^bpr8F{Qi*Xs9
zSNX#m(Rwuki8|~wJyD<M<DFkCTq77S7-ZtlT3z?HXuZ~$^6}T=n`hp(qvRdxHWZek
z9liS$Y2Sa5%jjvJs1t>TxtBgdX{D=Syi?HUA$}w~-p%Rl%lr_DJQyLuVDF!(rjkMv
zmpqn)nH^5}ydgL=W6QVxkB|`Fi+aW0l~v*Ad*{qguT2kcM(S9RF&~GDD*ag-MZd2s
z(0bR}h*nQKnB8$1)?qj{L|+eDHI0mCJ8~67G@GQ@...DFi~g(6!AlMP+l(hX6)g9X
z70?y8?b~CP6F98Y)cRj@...md88fLC*?X0}S&W>$q21}0YyauQ*y0x_H|HY;K9JN9
zAp@^QY@...nF^HSFsp>^3)@z!1??de)Om1C3mX7e|KC^q^bF9LU3;-2w2#_VJpN7r
z8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Xg2@...ajPNt+w_sNg(
z4#YE{nLQ)PLOM=_x>h@...%2<ei;fk5HJw<4+K0{6_ZbLejd;w10%LRv6Dl!xB%<U
zpAHfx0MPV{t*XEA%vOUvkT1C*_3HExkmbQL&d%KkmS-`T6?0y?FkO|2)7!`guGshK
zgPX!SvM%UtVab7nr~25DAfjN!j>V&O08L~h@...XV`_Qz!R=S{Hs(6(4_NOn+M)m^
zK>lNl-iAOamGH8q5BNIFe(*=A-pkz2Z}#w;iv^mMjozo`t{}0*|4NO%)Rt?JqVxL1
zj|JFtf4z4Cp573ww{-{Yu&LDF_tbUO`Eb2W_BDeRslUQtM7(}|`RqvXRGPl%n5{@!
zh~E2-7!Yjs#7z#!?`ptpy)%%1g5|gTKj1aE3<L}W3<L}W3<L}W3<L}W3<L}W3<L}W
z3<L}W3<L}W3<L}W3<L}W3<Umu1g-)sY}L}ax|b^bDc>Lb^6%Gzq2j+2fyt#_i0Ho-
IExNks-^UvQM*si-

literal 0
HcmV?d00001

diff --git a/tests/f_clear_orphan_file/name b/tests/f_clear_orphan_file/name
new file mode 100644
index 000000000000..89ba2247f437
--- /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 000000000000..2210e9ddc643
--- /dev/null
+++ b/tests/f_clear_orphan_file/script
@@ -0,0 +1,2 @@
+FSCK_OPT=-y
+. $cmd_dir/run_e2fsck

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ