Skip to contentSkip to conversation

generic: test i_blocks for large files

PATCH In review Pavel Reichl 2 participants 2 messages Aug 19, 2022 – Aug 20, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 generic: test i_blocks for large files

This is a regression test for an incorrect
computation of i_blocks for files larger than
4 GiB. Bug was filed for exFAT.

---
 tests/generic/694     | 47 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/694.out |  2 ++
 2 files changed, 49 insertions(+)
 create mode 100755 tests/generic/694
 create mode 100644 tests/generic/694.out
tests/generic/694 new file +47 -0
new file mode 100755
index 00000000..dfd988df
@@ -0,0 +1,47 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022  Red Hat Inc. All Rights Reserved.
+#
+# FS QA Test 694
+#
+# 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
+_require_fs_space $TEST_DIR $((4 * 1024 * 1024)) #kB
+
+echo "Silence is golden"
+
+junk_dir=$TEST_DIR/$seq
+junk_file=$junk_dir/junk
+mkdir -p $junk_dir
+
+$XFS_IO_PROG -f -c "pwrite -W 0 4G" $junk_file > /dev/null
+
+iblocks=`stat -c '%b' $junk_file`
+
+_test_cycle_mount
+
+iblocks_after_remount=`stat -c '%b' $junk_file`
+
+if [ "$iblocks" != "$iblocks_after_remount" ]; then
+	echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount"
+fi
+
+status=0
+
+exit
tests/generic/694.out new file +2 -0
new file mode 100644
index 00000000..d1fb84a2
@@ -0,0 +1,2 @@
+QA output created by 694
+Silence is golden
Signature · 1 line
2.37.2
Reviewed-by on v4 1/1
#1 lore raw
Quoted 6 lines · Pavel Reichl

This is a regression test for an incorrect
computation of i_blocks for files larger than
4 GiB. Bug was filed for exFAT.

---

Quoted 70 lines
 tests/generic/694     | 47 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/694.out |  2 ++
 2 files changed, 49 insertions(+)
 create mode 100755 tests/generic/694
 create mode 100644 tests/generic/694.out
tests/generic/694 new file +47 -0
new file mode 100755
index 00000000..dfd988df
@@ -0,0 +1,47 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022  Red Hat Inc. All Rights Reserved.
+#
+# FS QA Test 694
+#
+# 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
+_require_fs_space $TEST_DIR $((4 * 1024 * 1024)) #kB
+
+echo "Silence is golden"
+
+junk_dir=$TEST_DIR/$seq
+junk_file=$junk_dir/junk
+mkdir -p $junk_dir
+
+$XFS_IO_PROG -f -c "pwrite -W 0 4G" $junk_file > /dev/null
+
+iblocks=`stat -c '%b' $junk_file`
+
+_test_cycle_mount
+
+iblocks_after_remount=`stat -c '%b' $junk_file`
+
+if [ "$iblocks" != "$iblocks_after_remount" ]; then
+	echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount"
+fi
+
+status=0
+
+exit
tests/generic/694.out new file +2 -0
new file mode 100644
index 00000000..d1fb84a2
@@ -0,0 +1,2 @@
+QA output created by 694
+Silence is golden
Signature · 1 line
2.37.2