From: Eric Biggers <ebiggers@xxxxxxxxxx> 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 <ebiggers@xxxxxxxxxx> --- 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<i}I2|l(d8r2}(c$QE0?VNHSU=h7iI_Ng4==Bs2?z?A|i>@^AmTneHFEpWWYg zp6B!Yc4s|rxw`J{TT0#Hbp9ealY&~((C<`JJY3%8@5<?sNIc%_^?T6$Jg<7kd%any zr*~Z4Qu#c-ck6}y!BHRjosY&7roZ#Lb~o?!?ScmlU!4nZZ#{SJ@n5~`o45bN)#XjI zyV`1^C1E}=GDm55BH8!!LJ`QIfuK6X+%%-p6m`d;AX1=0d4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ev/null +++ b/tests/f_verity/mkimage.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# This is the script that was used to create the image.gz in this directory. + +set -e -u + +mkdir -p mnt +umount mnt &> /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