]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/rc: add _require_max_file_range_blocks helper
authorJoanne Chang <joannechien@google.com>
Thu, 8 Jan 2026 02:25:01 +0000 (02:25 +0000)
committerZorro Lang <zlang@kernel.org>
Mon, 9 Feb 2026 03:56:05 +0000 (11:56 +0800)
generic/735 attempts to create a file with nearly 2^32 blocks. However,
some filesystems have a maximum file block limit below this threshold.
For instance, F2FS is limited to approximately 2^30 blocks due to the
capacity of the inode. So add _require_blocks_in_file helper to skip the
test in such cases.

The helper uses a hardcoded constant instead of a programmatic method,
so that bugs which affect the maximum file size are not masked.

Signed-off-by: Joanne Chang <joannechien@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc
tests/generic/735

index 92cb69820311e70752a68b7d7d1e0bdd2a9795c3..fd4ca9641822cf8bf7e922ec8af60b43fb0c3076 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -6133,6 +6133,22 @@ _require_file_attr_special()
        fi
 }
 
+# Require filesystem to accomodate enough blocks in a file
+_require_max_file_range_blocks()
+{
+       local blocks=$1
+
+       case $FSTYP in
+       f2fs)
+               if [ $blocks -gt 1057053439 ]; then
+                       _notrun "$blocks blocks per file not supported on $FSTYP"
+               fi
+               ;;
+       *)
+               ;;
+       esac
+}
+
 ################################################################################
 # make sure this script returns success
 /bin/true
index 9bbdf3a17005fbbc00f9263b95fffba43438fcb9..60fa3dceab9de7c45cae3e4cdd2326af4bc3ecba 100755 (executable)
@@ -22,6 +22,7 @@ fi
 _require_odirect
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "finsert"
+_require_max_file_range_blocks $(( (1 << 32) - 1 ))
 
 dev_size=$((80 * 1024 * 1024))
 _scratch_mkfs_sized $dev_size >>$seqres.full 2>&1