ext4/002: remove EXT4_EOFBLOCKS_FL test

This test exercises obsolete ext4-specific functionality that will be
removed in the kernel's 5.7 release.  Once that happens, ext4/002 will
always fail, so remove the test to avoid the noise.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Eric Whitney
2020-02-14 11:42:49 -05:00
committed by Eryu Guan
parent 26e6cda8aa
commit 62ec71f6b2
3 changed files with 0 additions and 176 deletions
-168
View File
@@ -1,168 +0,0 @@
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2010 Google, Inc. All Rights Reserved.
#
# FS QA Test No. ext4/002
#
# Test to ensure that the EOFBLOCK_FL gets set/unset correctly.
#
# As found by Theodore Ts'o:
# If a 128K file is falloc'ed using the KEEP_SIZE flag, and then
# write exactly 128K, the EOFBLOCK_FL doesn't get cleared correctly.
# This is bad since it forces e2fsck to complain about that inode.
# If you have a large number of inodes that are written with fallocate
# using KEEP_SIZE, and then fill them up to their expected size,
# e2fsck will potentially complain about a _huge_ number of inodes.
# This would also cause a huge increase in the time taken by e2fsck
# to complete its check.
#
# Test scenarios covered:
# 1. Fallocating X bytes and writing Y (Y<X) (buffered and direct io)
# 2. Fallocating X bytes and writing Y (Y=X) (buffered and direct io)
# 3. Fallocating X bytes and writing Y (Y>X) (buffered and direct io)
#
# These test cases exercise the normal and edge case conditions using
# falloc (and KEEP_SIZE).
#
# Ref: http://thread.gmane.org/gmane.comp.file-systems.ext4/20682
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
# Test specific macros.
BIT_NOT_SET=0 # inode flag - 0x400000 bit is not set.
BIT_SET=1 # inode flag - 0x400000 bit is set.
# Generic test cleanup function.
_cleanup()
{
cd /
rm -f $tmp.*
}
# Ext4 uses the EOFBLOCKS_FL bit when fallocating blocks with KEEP_SIZE
# enabled. The only time this bit should be set is when extending the allocated
# blocks further than what the i_size represents. In the situations wherein the
# i_size covers all allocated blocks, this bit should be cleared.
# Checks the state of the sample file in the filesystem and returns whether
# the inode flag 0x400000 is set or not.
_check_ext4_eof_flag()
{
# Check whether EOFBLOCK_FL is set.
# For ext4 filesystems: use debugfs to check if EOFBLOCKS_FL is set.
# Other filesystems: do nothing. The default fsck at the end of the test
# should catch any potential errors.
if [ "${FSTYP}" == "ext4" ]; then
bit_set=1
# Unmount the ${SCRATCH_DEV}
_scratch_unmount
# Run debugfs to gather file_parameters - specifically iflags.
file_params=`debugfs ${SCRATCH_DEV} -R "stat ${1}" 2>&1 | grep -e Flags:`
iflags=${file_params#*Flags: }
# Ensure that the iflags value was parsed correctly.
if [ -z ${iflags} ]; then
echo "iFlags value was not parsed successfully." >> $seqres.full
status=1
exit ${status}
fi
# Check if EOFBLOCKS_FL is set.
if ((${iflags} & 0x400000)); then
echo "EOFBLOCK_FL bit is set." >> $seqres.full
bit_set=1
else
echo "EOFBLOCK_FL bit is not set." >> $seqres.full
bit_set=0
fi
# Check current bit state to expected value.
if [ ${bit_set} -ne ${2} ]; then
echo "Error: Current bit state incorrect." >> $seqres.full
status=1
exit ${status}
fi
# Mount the ${SCRATCH_DEV}
_scratch_mount
fi
}
# Get standard environment, filters and checks.
. ./common/rc
. ./common/filter
# Prerequisites for the test run.
_supported_fs ext4
_supported_os Linux
_require_xfs_io_command "falloc"
_require_scratch
# Real QA test starts here.
rm -f $seqres.full
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
# Begin test cases.
echo "Test 1: Fallocate 10 blocks and write 1 block (buffered io)." \
>> $seqres.full
${XFS_IO_PROG} -f \
-c "falloc -k 0 $((10 * $BLOCK_SIZE))" \
-c "pwrite 0 $BLOCK_SIZE" \
${SCRATCH_MNT}/test_1 | _filter_xfs_io_blocks_modified
_check_ext4_eof_flag test_1 ${BIT_SET}
echo "Test 2: Fallocate 10 blocks and write 1 block (direct io)." \
>> $seqres.full
${XFS_IO_PROG} -f -d \
-c "falloc -k 0 $((10 * $BLOCK_SIZE))" \
-c "pwrite 0 $BLOCK_SIZE" \
${SCRATCH_MNT}/test_2 | _filter_xfs_io_blocks_modified
_check_ext4_eof_flag test_2 ${BIT_SET}
echo "Test 3: Fallocate 10 blocks and write 10 blocks (buffered io)." \
>> $seqres.full
${XFS_IO_PROG} -f \
-c "falloc -k 0 $((10 * $BLOCK_SIZE))" \
-c "pwrite 0 $((10 * $BLOCK_SIZE))" \
${SCRATCH_MNT}/test_3 | _filter_xfs_io_blocks_modified
_check_ext4_eof_flag test_3 ${BIT_NOT_SET}
echo "Test 4: Fallocate 10 blocks and write 10 blocks (direct io)." \
>> $seqres.full
${XFS_IO_PROG} -f -d \
-c "falloc -k 0 $((10 * $BLOCK_SIZE))" \
-c "pwrite 0 $((10 * $BLOCK_SIZE))" \
${SCRATCH_MNT}/test_4 | _filter_xfs_io_blocks_modified
_check_ext4_eof_flag test_4 ${BIT_NOT_SET}
echo "Test 5: Fallocate 32 blocks, seek 64 blocks and write 1 block (buffered io)." \
>> $seqres.full
${XFS_IO_PROG} -f \
-c "falloc -k 0 $((32 * $BLOCK_SIZE))" \
-c "pwrite $((64 * $BLOCK_SIZE)) $BLOCK_SIZE" \
${SCRATCH_MNT}/test_5 | _filter_xfs_io_blocks_modified
_check_ext4_eof_flag test_5 ${BIT_NOT_SET}
echo "Test 6: Fallocate 32 blocks, seek to 64 blocks and write 1 block (direct io)." \
>> $seqres.full
${XFS_IO_PROG} -f -d \
-c "falloc -k 0 $((32 * $BLOCK_SIZE))" \
-c "pwrite $((64 * $BLOCK_SIZE)) $BLOCK_SIZE" \
${SCRATCH_MNT}/test_6 | _filter_xfs_io_blocks_modified
_check_ext4_eof_flag test_6 ${BIT_NOT_SET}
status=0
exit ${status}
-7
View File
@@ -1,7 +0,0 @@
QA output created by 002
Blocks modified: [0 - 0]
Blocks modified: [0 - 0]
Blocks modified: [0 - 9]
Blocks modified: [0 - 9]
Blocks modified: [64 - 64]
Blocks modified: [64 - 64]
-1
View File
@@ -4,7 +4,6 @@
# - comment line before each group is "new" description
#
001 auto prealloc quick zero
002 auto quick prealloc
003 auto quick
004 auto dump
005 auto quick metadata ioctl rw