ext4/002: Work with 64k block size
PATCH 1/2 ext4/002: Work with 64k block size
This commit changes the script to operate on FS blocks by obtaining the block size from the underlying filesystem and using it to perform I/O in units of block sizes.
This commit also uses $SCRATCH_MNT rather than $TEST_DIR for holding the test files since the FS on $TEST_DIR might be created with a different block size than the one specified in $MKFS_OPTIONS.
Signed-off-by Chandan Rajendra <[email protected]>
--- tests/ext4/002 | 68 ++++++++++++++++++++++++---------------------- tests/ext4/002.out | 18 ++++-------- 2 files changed, 41 insertions(+), 45 deletions(-)
tests/ext4/002 +35 -33
@@ -105,61 +105,63 @@ _check_ext4_eof_flag() _supported_fs ext4 _supported_os Linux _require_xfs_io_command "falloc" -_require_test +_require_scratch # Real QA test starts here. rm -f $seqres.full -# Remove any leftover files from last run. -rm -f ${TEST_DIR}/test_? +_scratch_mkfs >> $seqres.full 2>&1 +_scratch_mount + +BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT) # Begin test cases. -echo "Test 1: Fallocate 40960 bytes and write 4096 bytes (buffered io)." \ +echo "Test 1: Fallocate 10 blocks and write 1 block (buffered io)." \ >> $seqres.full -${XFS_IO_PROG} -f \ - -c 'falloc -k 0 40960' \ - -c 'pwrite 0 4096' \ - ${TEST_DIR}/test_1 | _filter_xfs_io_unique +${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 40960 bytes and write 4096 bytes (direct io)." \ +echo "Test 2: Fallocate 10 blocks and write 1 block (direct io)." \ >> $seqres.full -${XFS_IO_PROG} -f -d \ - -c 'falloc -k 0 40960' \ - -c 'pwrite 0 4096' \ - ${TEST_DIR}/test_2 | _filter_xfs_io_unique +${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 40960 bytes and write 40960 bytes (buffered io)." \ +echo "Test 3: Fallocate 10 blocks and write 10 blocks (buffered io)." \ >> $seqres.full -${XFS_IO_PROG} -f \ - -c 'falloc -k 0 40960' \ - -c 'pwrite 0 40960' \ - ${TEST_DIR}/test_3 | _filter_xfs_io_unique +${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 40960 bytes and write 40960 bytes (direct io)." \ +echo "Test 4: Fallocate 10 blocks and write 10 blocks (direct io)." \ >> $seqres.full -${XFS_IO_PROG} -f -d \ - -c 'falloc -k 0 40960' \ - -c 'pwrite 0 40960' \ - ${TEST_DIR}/test_4 | _filter_xfs_io_unique +${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 128k, seek 256k and write 4k block (buffered io)." \ +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 128k' \ - -c 'pwrite 256k 4k' \ - ${TEST_DIR}/test_5 | _filter_xfs_io_unique +${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 128k, seek to 256k and write a 4k block (direct io)." \ +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 128k' \ - -c 'pwrite 256k 4k' \ - ${TEST_DIR}/test_6 | _filter_xfs_io_unique +${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
tests/ext4/002.out +6 -12
@@ -1,13 +1,7 @@ QA output created by 002 -wrote 4096/4096 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 4096/4096 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 40960/40960 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 40960/40960 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 4096/4096 bytes at offset 262144 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 4096/4096 bytes at offset 262144 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Blocks modified: [0 - 0] +Blocks modified: [0 - 0] +Blocks modified: [0 - 9] +Blocks modified: [0 - 9] +Blocks modified: [64 - 64] +Blocks modified: [64 - 64]
Signature · 1 line
2.19.1
PATCH 2/2 ext4/021: Work with 64k block size
For 64k blocksize, 10MiB as the filesystem size isn't sufficient to have a journal included. Hence this commit computes the test FS size based on the block size of the underlying filesystem.
Signed-off-by Chandan Rajendra <[email protected]>
--- tests/ext4/021 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
tests/ext4/021 +7 -4
@@ -34,13 +34,16 @@ _supported_os Linux _require_scratch _require_dumpe2fs -# 10M in bytes -fssize=$((10 * 1024 * 1024)) +_scratch_mkfs >> $seqres.full 2>&1 +_scratch_mount +blocksize=$(_get_block_size $SCRATCH_MNT) +_scratch_unmount + +# With 4k block size, this amounts to 10M FS instance. +fssize=$((2560 * $blocksize)) _scratch_mkfs_sized $fssize >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV -blocksize=`$DUMPE2FS_PROG -h $SCRATCH_DEV 2>/dev/null | grep "Block size" | \ - awk '{print $3}'` offset=0 found=0 # this is the jbd2 journal superblock magic number on disk, in big endian
Signature · 1 line
2.19.1