This is a regression test for an incorrect computation of i_blocks for files larger than 4 GiB. Bug was filed for exFAT. Signed-off-by: Pavel Reichl <preichl@xxxxxxxxxx> --- tests/generic/693-inodes-for-large-files | 49 ++++++++++++++++++++ tests/generic/693-inodes-for-large-files.out | 1 + 2 files changed, 50 insertions(+) create mode 100755 tests/generic/693-inodes-for-large-files create mode 100644 tests/generic/693-inodes-for-large-files.out diff --git a/tests/generic/693-inodes-for-large-files b/tests/generic/693-inodes-for-large-files new file mode 100755 index 00000000..797d6a21 --- /dev/null +++ b/tests/generic/693-inodes-for-large-files @@ -0,0 +1,49 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Red Hat Inc. All Rights Reserved. +# +# FS QA Test 693 +# +# Verify that i_blocks for files larger than 4 GiB have correct +# values. +# +# This test verifies the problem fixed in kernel with commit +# 0c336d6e33f4 exfat: fix incorrect loading of i_blocks for large files +# +. ./common/preamble +_begin_fstest auto + +# Override the default cleanup function. +_cleanup() +{ + cd / + rm -r -f $tmp.* $junk_dir +} + +_supported_fs generic +_require_test + +junk_dir=$TEST_DIR/$seq +junk_file=$junk_dir/junk +mkdir -p $junk_dir + +$XFS_IO_PROG -f -c "truncate 4G" $junk_file + +iblocks=`$XFS_IO_PROG -c "stat" $junk_file | grep 'stat.blocks'` +test -z "$iblocks" && echo 'Failed to parse the blocks' + +_test_cycle_mount + +iblocks_after_remount=`$XFS_IO_PROG -c "stat" $junk_file | grep 'stat.blocks'` + +test -z "$iblocks_after_remount" && echo 'Failed to parse the blocks' + +if [ "$iblocks" != "$iblocks_after_remount" ]; then + echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount" + status=1 + exit +fi + +status=0 + +exit diff --git a/tests/generic/693-inodes-for-large-files.out b/tests/generic/693-inodes-for-large-files.out new file mode 100644 index 00000000..f39aa77c --- /dev/null +++ b/tests/generic/693-inodes-for-large-files.out @@ -0,0 +1 @@ +QA output created by 693-inodes-for-large-files -- 2.37.1