]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
f2fs: test special mount options
authorChao Yu <chao@kernel.org>
Mon, 4 Aug 2025 11:40:15 +0000 (19:40 +0800)
committerZorro Lang <zlang@kernel.org>
Fri, 15 Aug 2025 16:11:25 +0000 (00:11 +0800)
As f2fs changes to use new mount APIs, let's add a new testcase
to check mount result for all f2fs supported special mount options
and their combinations, in order to detect any inconsistency during
mount.

Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/f2fs/016 [new file with mode: 0755]
tests/f2fs/016.out [new file with mode: 0644]

diff --git a/tests/f2fs/016 b/tests/f2fs/016
new file mode 100755 (executable)
index 0000000..800f75f
--- /dev/null
@@ -0,0 +1,50 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2025 Chao Yu.  All Rights Reserved.
+#
+# FS QA Test No. f2fs/016
+#
+# This testcase tries to check stability of mount result
+# w/ f2fs special mount options and their combination.
+#
+. ./common/preamble
+_begin_fstest auto quick mount
+_require_kernel_config CONFIG_F2FS_FS_COMPRESSION
+_require_kernel_config CONFIG_F2FS_FS_LZO
+_require_kernel_config CONFIG_F2FS_FS_LZORLE
+_require_kernel_config CONFIG_F2FS_FS_LZ4
+_require_kernel_config CONFIG_F2FS_FS_LZ4HC
+_require_kernel_config CONFIG_F2FS_FS_ZSTD
+
+options=(
+#      mount_option                    mkfs_option
+       "inline_xattr_size=400"         "extra_attr,flexible_inline_xattr"\
+       "compress_algorithm=lzo"        "extra_attr,compression"        \
+       "compress_algorithm=lz4"        "extra_attr,compression"        \
+       "compress_algorithm=zstd"       "extra_attr,compression"        \
+       "compress_algorithm=lzo-rle"    "extra_attr,compression"        \
+       "compress_algorithm=lz4:3"      "extra_attr,compression"        \
+       "compress_algorithm=zstd:1"     "extra_attr,compression"        \
+       "compress_log_size=8"           "extra_attr,compression"        \
+       "compress_extension=so"         "extra_attr,compression"        \
+       "nocompress_extension=so"       "extra_attr,compression"        \
+       "nocompress_extension=*"        "extra_attr,compression"        \
+       "compress_extension=so,nocompress_extension=so"                 \
+                                       "extra_attr,compression"        \
+       "compress_chksum"               "extra_attr,compression"        \
+       "compress_mode=fs"              "extra_attr,compression"        \
+       "compress_mode=user"            "extra_attr,compression"        \
+       "compress_cache"                "extra_attr,compression"        \
+)
+
+for ((i=0;i<${#options[@]};i=i+2))
+do
+       echo "Option#$i: ${options[$i]} : ${options[$((i+1))]}"
+       _scratch_mkfs "-O ${options[$((i+1))]}" >> $seqres.full || _fail "mkfs failed"
+       _try_scratch_mount "-o ${options[$i]}" >> $seqres.full 2>&1
+       echo $?
+       _scratch_unmount >> $seqres.full 2>&1
+done
+
+status=0
+exit
diff --git a/tests/f2fs/016.out b/tests/f2fs/016.out
new file mode 100644 (file)
index 0000000..a8c9697
--- /dev/null
@@ -0,0 +1,33 @@
+QA output created by 016
+Option#0: inline_xattr_size=400 : extra_attr,flexible_inline_xattr
+0
+Option#2: compress_algorithm=lzo : extra_attr,compression
+0
+Option#4: compress_algorithm=lz4 : extra_attr,compression
+0
+Option#6: compress_algorithm=zstd : extra_attr,compression
+0
+Option#8: compress_algorithm=lzo-rle : extra_attr,compression
+0
+Option#10: compress_algorithm=lz4:3 : extra_attr,compression
+0
+Option#12: compress_algorithm=zstd:1 : extra_attr,compression
+0
+Option#14: compress_log_size=8 : extra_attr,compression
+0
+Option#16: compress_extension=so : extra_attr,compression
+0
+Option#18: nocompress_extension=so : extra_attr,compression
+0
+Option#20: nocompress_extension=* : extra_attr,compression
+32
+Option#22: compress_extension=so,nocompress_extension=so : extra_attr,compression
+32
+Option#24: compress_chksum : extra_attr,compression
+0
+Option#26: compress_mode=fs : extra_attr,compression
+0
+Option#28: compress_mode=user : extra_attr,compression
+0
+Option#30: compress_cache : extra_attr,compression
+0