From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,INCLUDES_PATCH,LOTS_OF_MONEY,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C827BC04AB6 for ; Tue, 28 May 2019 23:13:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9BD6F20989 for ; Tue, 28 May 2019 23:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559085228; bh=OyLfWHPPXzaZzqmIC/KJdKCkAaN0fDnemk19P19bgd8=; h=From:To:Subject:Date:List-ID:From; b=iCpIrZenK60uHTI22UfIMTPkDe6GiDl+3d0rzJTngD66GADWseT5YB2CBsYPPaYUM mCV+fMt6LGDK01+GVzVCRGb4j5YMQtm3vvLCw/mU0Deq7WO3WjYV5hkQwE49pCIw4k eYPqT6qWkC6TGaAS6B92g4Ka63D2CgG75MrjKJ0w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726867AbfE1XNs (ORCPT ); Tue, 28 May 2019 19:13:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:57218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726463AbfE1XNs (ORCPT ); Tue, 28 May 2019 19:13:48 -0400 Received: from ebiggers-linuxstation.mtv.corp.google.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 87F8B20989 for ; Tue, 28 May 2019 23:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559085226; bh=OyLfWHPPXzaZzqmIC/KJdKCkAaN0fDnemk19P19bgd8=; h=From:To:Subject:Date:From; b=zghF678uWBkG6d60sdlywb4nxnIe3xfg79ZRsw19XugTb18M0upqnE6++ve7eSHY0 W08a7gUp3lqo4xLD0h6Qpqhq9W/AP08Ww0Vp3he5QRBXwWMVNIx36Z4L0Jjcd5MtTy 8k0wEBazZz1CjRxLV7weTdST3U+7C4OA73J9AgYo= From: Eric Biggers To: linux-ext4@vger.kernel.org Subject: [PATCH e2fsprogs] tests: add test for e2fsck of verity file Date: Tue, 28 May 2019 16:12:30 -0700 Message-Id: <20190528231230.234342-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.22.0.rc1.257.g3120a18244-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Eric Biggers Test that e2fsck doesn't report errors when an inode with the 'verity' flag has blocks past i_size. This is a regression test for commits 3baafde6a8ae ("e2fsck: allow verity files to have initialized blocks past i_size") and 43466d039689 ("e2fsck: handle verity files in scan_extent_node()"). Signed-off-by: Eric Biggers --- tests/f_verity/expect.1 | 7 +++++++ tests/f_verity/image.gz | Bin 0 -> 2247 bytes tests/f_verity/mkimage.sh | 28 ++++++++++++++++++++++++++++ tests/f_verity/name | 1 + tests/f_verity/script | 2 ++ 5 files changed, 38 insertions(+) create mode 100644 tests/f_verity/expect.1 create mode 100644 tests/f_verity/image.gz create mode 100755 tests/f_verity/mkimage.sh create mode 100644 tests/f_verity/name create mode 100644 tests/f_verity/script diff --git a/tests/f_verity/expect.1 b/tests/f_verity/expect.1 new file mode 100644 index 00000000..07059677 --- /dev/null +++ b/tests/f_verity/expect.1 @@ -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: 12/128 files (8.3% non-contiguous), 58/128 blocks +Exit status is 0 diff --git a/tests/f_verity/image.gz b/tests/f_verity/image.gz new file mode 100644 index 0000000000000000000000000000000000000000..72dfd8169ace0e2a2ace35f5d2c010601623b168 GIT binary patch literal 2247 zcmd6neNYp38pl()19U9$#yh>15_Hh=E(%hjAeqsQ6)*+N@KPj%+!;6#4X@IWz*;L( zUuYD@^AmTneHFEpWWYg zp6B!Yc4s|rxw`J{TT0#Hbp9ealY&~((C<`JJY3%8@5vaH(4AApr+di_5qP?Vv4zN z^eveGWpa-%jtCzuTMt#Qmpz^7p6Q&WcbxVa-}mlC0G!pMid;FYCoMa%N%+rILB%}^ zth!6jZsyP-U;hFL8`#F7LH}HE_B;;%s#+5WjZgI2_WL_q@iH1=0kCY(s-{Y<)`iK( za_ORRAcNL;k*WdH#oxf=FiQ`E1J0ug`))|@KU50Fi9^b+Im{iY{lOIYi$1r;Qz}u8 zBFHmZ1gKt7`mM&5A>j zRD(f^=sa4aXKd`XAA1A@8wp4KRKRi+jikjj@`1U%8d9uEBrCC}Am)Q!N+UAWDEDI6 zBO}br@TeMqic%Sj6B0<9Rj^Uba(qTr=k24w;kIvyi1{%l6<-V`1(c>2N}!*Why|Hh2a0hRHiKBOM#)EjqM#Y&rZ$yb8ZSq-f3cPbpT2%@I!y)(%yh=nLx?4`L ziOjMVbgL2GaH{A)4Dh#V2demRRoLVzkL92`WG{++?M1!0@C3`zXUYNy5{LwJ&dVRN z;k%017!};SH@p(s;HdH&!&;5NleNlaU%O%|JlFtw)>poHZd7dg_-f-bdJJX8QcNhVbS+0hRjYjCG`Q!$nT1H9q_KmyHOE;w4VvS@}r z-g(9bEZQzciC}xz_pxgUl+ACq@>S^}L2h$$;_@Y8Vq$#!y8Be%w)dsFz|=E^hRHHP z;OcP$m0~`hBEW*JwEW`T(aNwQzfu208R>8rKkk|H(+I7ibcS=D1qQM@Vt$Zykxt=) zBz7d%Hm-9zu8C-$FO0D}UCJC#W-hgf*S(DJ@TO|9xXzCQnRjjc0w3DqC6rWVi0E|MwFolXb>nOHR@2+6YXV>W~X5GxRbS~nf2p{>-3-)bfVH!!0{xt6xWSn>) zB-NQESYCVY$i_L0&V3isYbF+?h0ypX10!E%=jKolYwVzjgffja7G7KpZ1R9Fvc z$2M~xBRMvruI)kODwqgdLjZppfv542dqzNmkLM0u-vK06wOMX+c;zsyjv9@qx4xv+ znM05=^_zVSWSIFrvek6j56C}hj`!Nv48!A3Rv=I0J!7RTx+`*hZU_E%M&LJ(Q{0)( z%VkmGD*HTH_DZ1A=&u*1rDcMl(#33b1n=z6{#^C7v0$D8%}q!Xpt*%B3iJVx979%hVUgu /dev/null || true + +dd if=/dev/zero of=image bs=4096 count=128 +mke2fs -O 'verity,extents' -b 4096 -N 128 image +mount image mnt + +# Create a verity file, but make it fragmented so that it needs at least one +# extent tree index node, in order to cover the scan_extent_node() case. +for i in {1..80}; do + head -c 4096 /dev/zero > mnt/tmp_$i +done +for i in {1..80..2}; do + rm mnt/tmp_$i +done +head -c $((40 * 4096)) /dev/zero > mnt/file +fsverity enable mnt/file +rm mnt/tmp_* + +umount mnt +rmdir mnt +gzip -9 -f image diff --git a/tests/f_verity/name b/tests/f_verity/name new file mode 100644 index 00000000..f43910fc --- /dev/null +++ b/tests/f_verity/name @@ -0,0 +1 @@ +verity file diff --git a/tests/f_verity/script b/tests/f_verity/script new file mode 100644 index 00000000..8ab2b9c6 --- /dev/null +++ b/tests/f_verity/script @@ -0,0 +1,2 @@ +ONE_PASS_ONLY="true" +. $cmd_dir/run_e2fsck -- 2.22.0.rc1.257.g3120a18244-goog