aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2021-11-07 20:36:20 -0800
committerEryu Guan <guaneryu@gmail.com>2021-11-14 18:43:11 +0800
commit1adc9f01994c3cb1b1870eb5a55f31046b39e934 (patch)
tree21f442a0714d420b0674cb0f747f3c0319a51413
parent08ea29c66c7887a3f0b5a34ce080f2908270f0d9 (diff)
downloadxfstests-dev-1adc9f01994c3cb1b1870eb5a55f31046b39e934.tar.gz
generic/574: remove invalid test of read completely past EOF
One of the test cases in generic/574 tests that if a file of length 130999 has fs-verity enabled, and if bytes 131000..131071 (i.e. some bytes past EOF and in the same block as EOF) are corrupted with nonzero values, then reads of the corrupted part should fail with EIO. This isn't a valid test case, because reads that start at or past EOF are allowed to simply return 0 without doing any I/O. Therefore, don't run this test case. This fixes a test failure caused by the kernel commit 8c8387ee3f55 ("mm: stop filemap_read() from grabbing a superfluous page"). Note that the other test cases for this same corrupted file remain valid, including testing that an error is reported during full file reads and during mmap "reads". This is because the fs-verity Merkle tree is defined over full blocks, so the file's last block won't be readable if it contains corrupted (nonzero) bytes past EOF. This may seem odd, but it's working as intended, especially considering that bytes past EOF in a file's last block are exposed to userspace in mmaps. Signed-off-by: Eric Biggers <ebiggers@google.com>
-rwxr-xr-xtests/generic/5742
-rw-r--r--tests/generic/574.out2
2 files changed, 1 insertions, 3 deletions
diff --git a/tests/generic/574 b/tests/generic/574
index df0ef95fb7..882baa21a3 100755
--- a/tests/generic/574
+++ b/tests/generic/574
@@ -106,7 +106,7 @@ corruption_test()
dd if=$fsv_file bs=$FSV_BLOCK_SIZE iflag=direct status=none \
of=/dev/null |& _filter_scratch
- if ! $is_merkle_tree; then
+ if (( zap_offset < file_len )) && ! $is_merkle_tree; then
echo "Validating corruption (reading just corrupted part)..."
dd if=$fsv_file bs=1 skip=$zap_offset count=$zap_len \
of=/dev/null status=none |& _filter_scratch
diff --git a/tests/generic/574.out b/tests/generic/574.out
index d43474c594..3c08d3e802 100644
--- a/tests/generic/574.out
+++ b/tests/generic/574.out
@@ -63,8 +63,6 @@ Validating corruption (reading full file)...
md5sum: SCRATCH_MNT/file.fsv: Input/output error
Validating corruption (direct I/O)...
dd: error reading 'SCRATCH_MNT/file.fsv': Input/output error
-Validating corruption (reading just corrupted part)...
-dd: error reading 'SCRATCH_MNT/file.fsv': Input/output error
Validating corruption (reading full file via mmap)...
Bus error
Validating corruption (reading just corrupted part via mmap)...