From patchwork Fri Aug 1 18:13:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrick Wong X-Patchwork-Id: 375843 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3D2631400E7 for ; Sat, 2 Aug 2014 04:13:53 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755950AbaHASNw (ORCPT ); Fri, 1 Aug 2014 14:13:52 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:36932 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851AbaHASNr (ORCPT ); Fri, 1 Aug 2014 14:13:47 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s71IDipa021346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Aug 2014 18:13:45 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s71IDiGe001731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Aug 2014 18:13:44 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s71IDiQZ025178; Fri, 1 Aug 2014 18:13:44 GMT Received: from localhost (/24.21.154.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 01 Aug 2014 11:13:43 -0700 Subject: [PATCH 18/19] tests: add regression tests for group descriptors with bad checksums From: "Darrick J. Wong" To: tytso@mit.edu, darrick.wong@oracle.com Cc: linux-ext4@vger.kernel.org Date: Fri, 01 Aug 2014 11:13:42 -0700 Message-ID: <20140801181342.12496.94782.stgit@birch.djwong.org> In-Reply-To: <20140801181139.12496.14390.stgit@birch.djwong.org> References: <20140801181139.12496.14390.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Darrick J. Wong Add tests to examine how e2fsck deals with (a) the block bitmap being corrupt; (b) the inode bitmap being corrupt; (c) the bitmap checksums being incorrect (but the bitmaps are fine); and (d) the group descriptor checksum itself is incorrect. Signed-off-by: Darrick J. Wong --- tests/f_bad_bbitmap/expect.1 | 15 +++++++++++++++ tests/f_bad_bbitmap/expect.2 | 7 +++++++ tests/f_bad_bbitmap/image.gz | Bin tests/f_bad_bbitmap/name | 1 + tests/f_bad_bmap_csum/expect.1 | 16 ++++++++++++++++ tests/f_bad_bmap_csum/expect.2 | 7 +++++++ tests/f_bad_bmap_csum/image.gz | Bin tests/f_bad_bmap_csum/name | 1 + tests/f_bad_gdt_csum/expect.1 | 10 ++++++++++ tests/f_bad_gdt_csum/expect.2 | 7 +++++++ tests/f_bad_gdt_csum/image.gz | Bin tests/f_bad_gdt_csum/name | 1 + tests/f_bad_ibitmap/expect.1 | 15 +++++++++++++++ tests/f_bad_ibitmap/expect.2 | 7 +++++++ tests/f_bad_ibitmap/image.gz | Bin tests/f_bad_ibitmap/name | 1 + 16 files changed, 88 insertions(+) create mode 100644 tests/f_bad_bbitmap/expect.1 create mode 100644 tests/f_bad_bbitmap/expect.2 create mode 100644 tests/f_bad_bbitmap/image.gz create mode 100644 tests/f_bad_bbitmap/name create mode 100644 tests/f_bad_bmap_csum/expect.1 create mode 100644 tests/f_bad_bmap_csum/expect.2 create mode 100644 tests/f_bad_bmap_csum/image.gz create mode 100644 tests/f_bad_bmap_csum/name create mode 100644 tests/f_bad_gdt_csum/expect.1 create mode 100644 tests/f_bad_gdt_csum/expect.2 create mode 100644 tests/f_bad_gdt_csum/image.gz create mode 100644 tests/f_bad_gdt_csum/name create mode 100644 tests/f_bad_ibitmap/expect.1 create mode 100644 tests/f_bad_ibitmap/expect.2 create mode 100644 tests/f_bad_ibitmap/image.gz create mode 100644 tests/f_bad_ibitmap/name -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tests/f_bad_bbitmap/expect.1 b/tests/f_bad_bbitmap/expect.1 new file mode 100644 index 0000000..71ad1bb --- /dev/null +++ b/tests/f_bad_bbitmap/expect.1 @@ -0,0 +1,15 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0x49ff, should be 0x4972. FIXED. +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 +Block bitmap differences: -(8--10) -(12--17) -(19--31) +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_bad_bbitmap/expect.2 b/tests/f_bad_bbitmap/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bad_bbitmap/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: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_bbitmap/image.gz b/tests/f_bad_bbitmap/image.gz new file mode 100644 index 0000000000000000000000000000000000000000..c488ecd365b99c51a304597c0944444e0552c57d GIT binary patch literal 2546 zcmb2|=3tPuydKQN{Pvb@MzEs{!-wijhs@@wyEMdfSk)E#woVp}J#uhiFnj4n-m6LN zCJUln-|8s!@wvWG>gZ_Vi<)y}mqv!`QAfeuKh{1_|M=8-q5x}dX3o9$;_vjz_e|gO z|McF+@1C|Ys9dek^lsgtrWfa?D6;D9$}FvXgSfkTW|xg`%R6nn@n4JU;`u7q5Z&9W zrur5Z+WwpH_oYCT-Tj%fX5aW#_UUI==y|?%wsvMSQpAx?&qTj}L>h3+2 zw|B0re*JxJ<%dKCu3E*(zf9M)UX|Rx$m;FO9fiBsxi{P9+%3Hq$v|w(156D+kV6dcjxCJzl?AHIuzJ@(j0PNP zKA5LfrTwm7a`e}^KH1*>-$$oeL`UlXo3>$3OxUMu<$)gmH^qnCOR8)0Z@VC=mY!YT zzU0f!#;YgyJ=2TvF8g!8Pu2QguW_$^+sDI&W_QEW|8%cXzP~?v^-6csufNT`9>>26 z4m!SH-+l7k|N3#hWq)>F2daH}>Cf`@_x`Ah?)qo&-!uGjP0g99>;CVaKB?+2D4<8d iXb6mkz-S1JhQMeDjD`R$LSVy(eath088aCe6c_+dh#I*7 literal 0 HcmV?d00001 diff --git a/tests/f_bad_bbitmap/name b/tests/f_bad_bbitmap/name new file mode 100644 index 0000000..923ddcb --- /dev/null +++ b/tests/f_bad_bbitmap/name @@ -0,0 +1 @@ +corrupt block bitmap (metadata_csum) diff --git a/tests/f_bad_bmap_csum/expect.1 b/tests/f_bad_bmap_csum/expect.1 new file mode 100644 index 0000000..ca8f77f --- /dev/null +++ b/tests/f_bad_bmap_csum/expect.1 @@ -0,0 +1,16 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0x4972, should be 0x7074. FIXED. +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 +Inode bitmap differences: Group 0 inode bitmap does not match checksum. +FIXED. +Block bitmap differences: Group 0 block bitmap does not match checksum. +FIXED. + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_bad_bmap_csum/expect.2 b/tests/f_bad_bmap_csum/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bad_bmap_csum/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: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_bmap_csum/image.gz b/tests/f_bad_bmap_csum/image.gz new file mode 100644 index 0000000000000000000000000000000000000000..70a0d1812b9c030959651bd068f1331e36330578 GIT binary patch literal 2546 zcmb2|=3pqYxE{>J{Pvc0hKQpC!-Jb=8x<{WI(w522y75al3d%9p)4l0GH6BbNkLvV zAEsNbSFR`}WeT>KG<9fXEIjDdGj)NWD7UN6V`ljWlZ)RkY7MXy-e*eAe`^cS__D9l>C5UkvCvc3 zyi$vU?s(ZfNlg3`r57h+OPLpf6qH<37J>&mR6fWHpz2AH;?FhcU_?+DKH#?u`FgW}YS-wBl^Oero z|Hmg)ExQuu@#N6M`+mXiV=T7czRAqM(C~EOg*lw}XNhgFXJBCXa9{i1|M|RucSKK} zXG(FFDKDKm|6%QdGdW**xLWki=KW3>AoQG z`v1AF%h!wFuRmca4-#1M`v30ed1oX4gKUDSsRzms10vpWX|H+(ROxWIke!7X9oW@0 z>^Hn@d;7Ps?$z>bZ&%gdS-(y7=BlWV=B>|yBF{zNb5}IZ-@jtZ(L+4*I2YRboD2KU zm-(`|Hv3ZT+1PzE-~HG>->3Y~?6g<)Jdcl0%GtI2*bnhgw|({3qeA;vz2eUoKfeFZ z^DTY#@%~G8|Bv4}@!gNl`LFAFE+75r@4xn^zl_yCga0Q(E;-el5?}xSclhP1zre5< k1*0J_8UmvsFd71*Aut*OGzozXKk671F0Px-z@WeY0F<&6$N&HU literal 0 HcmV?d00001 diff --git a/tests/f_bad_bmap_csum/name b/tests/f_bad_bmap_csum/name new file mode 100644 index 0000000..df19fe3 --- /dev/null +++ b/tests/f_bad_bmap_csum/name @@ -0,0 +1 @@ +bad block/inode bitmap csum (metadata_csum) diff --git a/tests/f_bad_gdt_csum/expect.1 b/tests/f_bad_gdt_csum/expect.1 new file mode 100644 index 0000000..e14c897 --- /dev/null +++ b/tests/f_bad_gdt_csum/expect.1 @@ -0,0 +1,10 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0xffff, should be 0x4972. FIXED. +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: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_gdt_csum/expect.2 b/tests/f_bad_gdt_csum/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bad_gdt_csum/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: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_gdt_csum/image.gz b/tests/f_bad_gdt_csum/image.gz new file mode 100644 index 0000000000000000000000000000000000000000..c3fdafe6627561f7de16ea09a6f02d52f6265b00 GIT binary patch literal 2548 zcmb2|=3uC|xE{>J{Pvb@MzEs{!-wk31DC|KO9OQxxcr=CvemVBbu>FK=X;eTz3M1m zro;BGTahj@vRxNk1q4}Tw^($R243juYE~-y7=6(H(dqUeCy^~nH&*VC-?977$GA`b z^uPD*o-WQbA>{E<9nnL#c2tPAPFTNXxz@@p2P;x{-|#t~Q_s=r^#8Sn%l=oXflG7N zhL{~c+WW(qZ;5lpucGp-yrkQ^Pl{`Y+uLt>cjQJwUe5aqA5J8^E67`!Wc%w)$+uI} z-acRcF8@aTw};0YHNLcNyYgp;Sa|xMuB>Kxm-~i10|Ud4_oDy*=W_>Y z37Dy90Y z6^PJ)OUa+!ne%S`o1eLI-{$1>zmMy7nw|^0+O=QPWcsP1d!OvMURM5gU8*aV_9KL2 zZer24U*#TN^Q9vuzsY|0=xfUH|9>ksJ-%-e{6AU3UMT%?t?9A-D~vw<-FXXu@)|CM#NK4{@<{?GGERCSLm&-wUkf4Sw# o>-M4uzZ3heLcj9= z^y=exPjfSRtm+J!#+B$Bv!};NBjk4Q)sTA$i+084Y%9-GXh|x35Gt~0{@1P*QQN|` zXFqyW^+)mdWyLKu`;2YvcYb|)<+JGOd9pFpH8mRc`_d~?N;K*<_J?egtE|#0ul&5N z`11E_@2x*SIGiBz%USJfc1-tb?K;=eTbBzTm&Nw8Ro~e5de3GChLgdw{*@hDx!mTz z{*kXGJNN2W|Mpd!_xyj}{@LmN?@PWhFfb%kYHV9}`1&-~H~c`}pYLA(|ED`mIn{P* zGsDaYUa6a>rdP<9ZdvMf{L^FUw&Psv-*$yF0TrJ1Rckpu`R>lUZ%tqS|Jirympo7~ zqwj0|`CY={UhnUhTYv;Eta<%Ey4L^M+W(9U3(= zL(K>CwCd+(zxz^6~xYi%-7$FTP&Q`rn<`K(#)Z|1QVp|C`Kpw|>U|C95+P?VfpE|9{upbMHT3 mSd4