From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9A3D17D37F for ; Tue, 11 Jun 2024 14:27:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718116044; cv=none; b=rl1PsnZrponDRPq9DqFwuAmZ25HGX7xUEYpEiS+qzXzWP+7sccMGuscsJ6TCL/q6GWM8omnfXSqsx6wiYdVbAOIedngFHG/1QjBF+9L5+t6mnHKjQINp67n1KDkGtw1VUrngd0vzgzPCLFfYniRM/4ep7lEqdmu1NXXM2AWm/4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718116044; c=relaxed/simple; bh=9OVLDd3Yu9UCiziiAvm9ItkzIFw1PjMJSxfOXYmGtgg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FYGyJhiRk1F/tsU0TO8l+72kKLbPcpfQF7NNMeQzZO5tnMSiGLgePhHyWKlP/sLZXaNrTohhsTU7iAcD1IjqLPI8ACNGqj5YuZ0Ej/BSZJ3IXydizsoDjeQelmoX4LSPVYBPISkHub6AWgTUMoycuD4QDrJE3hxXTb3y8uFywkA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=RTMCoK7u; arc=none smtp.client-ip=95.215.58.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="RTMCoK7u" X-Envelope-To: tytso@mit.edu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1718116039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W4+a1L/4As5eiy1DYW4abQi34HRzCHFF0qxZs0Epg74=; b=RTMCoK7u48V8Bz1WH5IkzQ3kL4iwfxB/0GIA+nZ+uFN8rA+XyAbn60xcbxLvdIZEtptwVB lxw8ddt5Ctx/hFZFidgMg3+8w82dGrRw7j8NVIKruHecSuKMnxMa4nKYeL7WD9FzGu4qhy WwC1rMewTloGzYFwsuoJZALr6Ne2Nrg= X-Envelope-To: linux-ext4@vger.kernel.org X-Envelope-To: luis.henriques@linux.dev X-Envelope-To: adilger@dilger.ca X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Luis Henriques (SUSE)" To: Theodore Ts'o , Andreas Dilger Cc: linux-ext4@vger.kernel.org, "Luis Henriques (SUSE)" Subject: [PATCH 2/2] tests: new test to check that the orphan file is cleaned up Date: Tue, 11 Jun 2024 15:27:04 +0100 Message-ID: <20240611142704.14307-3-luis.henriques@linux.dev> In-Reply-To: <20240611142704.14307-1-luis.henriques@linux.dev> References: <20240611142704.14307-1-luis.henriques@linux.dev> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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) --- 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!%@BLvv z`}chiN&ooAQjfD?Uo1Hn@pE|SqVb`xAD#@YTlCkyrfq*XEpuA>_Qx%+mu8tXU377n z>~EU74zKD>Ie5&${)lTxtBgdX{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@v$6DFi~g(6!AlMP+l(hX6)g9X z70?y8?b~CP6F98Y)cRj@9Tjmd88fLC*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r?{tV}LFiy;iV-1p!RG%m-@NrQ1(Nai+- zPpL5;vB=#20t$4GYs`E0!kt2@>cx-Y@1{{vjpp56$b6RbDZ%2g>XbC9bz@|=7tD?F zw5r#AO!gox&ND7zw2?|PZ|v;$Vim9gP6?<|m8)xDPEgXhB9m_6ZcEu!>3Vlp&ch(e zxuRtStjJS>0;%m$SNm;^1(G0+=lvkwxgu;2*4`2y7{@7m_QHd*xVm@cnCwYf+`+hr z=g%VDC~K;Fm-Ju{TjGz$X`eqceGufTI_3>~uKdy7=74!?_p%(+nflU+H9;|9+Y?U|j%&pZ9ekPtVn2vi$m#s{%zd`F z_&1eP8l+m?mn0rj&%IFmb8{y`qB@lz>jLg*Ut$PXAuf2UgJpS>xScD%PIn{O9sWNr z71GB8;2E}lMMJdwH(tC_ZapvFB094!`f?SK!~zy17fnmb(6wh}58xpS2XEvAG|BiA z%xg*Ar<(%+GcjHRQkU&ozbDWAmR=b`8QL_mJx+7{07C~^S1>qigiNaG%nF{@PK`c@ zi-BB4>$`3t4=pU`STd}}h1vW022*gf0lf%0A{Dt;i0#JDGGdCGJ$BPgn8`k0UDhRu56MK54axk_3R_Oh@Bwf%2V&O08L~h@qL$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|gTKj1aE3Lb^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