]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
f2fs: test mount options for zoned device
authorChao Yu <chao@kernel.org>
Mon, 4 Aug 2025 11:40:16 +0000 (19:40 +0800)
committerZorro Lang <zlang@kernel.org>
Fri, 15 Aug 2025 16:11:48 +0000 (00:11 +0800)
As f2fs changes to use new mount APIs, let's add a new testcase
to check mount result for special mount options for zoned device
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/017 [new file with mode: 0755]
tests/f2fs/017.out [new file with mode: 0644]

diff --git a/tests/f2fs/017 b/tests/f2fs/017
new file mode 100755 (executable)
index 0000000..cdf42fc
--- /dev/null
@@ -0,0 +1,40 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2025 Chao Yu.  All Rights Reserved.
+#
+# FS QA Test No. f2fs/017
+#
+# This testcase tries to check stability of mount result
+# w/ mount options for zoned device and their combination.
+#
+. ./common/preamble
+_begin_fstest auto quick mount
+
+_require_zoned_device "$TEST_DEV"
+_test_unmount >> $seqres.full 2>&1
+
+options=(
+#      mount_option                    mkfs_option
+       "background_gc=on"              "blkzone"               \
+       "background_gc=off"             "blkzone"               \
+       "background_gc=sync"            "blkzone"               \
+       "mode=adaptive"                 "blkzone"               \
+       "mode=lfs"                      "blkzone"               \
+       "mode=fragment:segment"         "blkzone"               \
+       "mode=fragment:block"           "blkzone"               \
+       "discard_unit=block"            "blkzone"               \
+       "discard_unit=segment"          "blkzone"               \
+       "discard_unit=section"          "blkzone"               \
+)
+
+for ((i=0;i<${#options[@]};i=i+2))
+do
+       echo "Option#$i: ${options[$i]} : ${options[$((i+1))]}"
+       _test_mkfs "-m" >> $seqres.full || _fail "mkfs failed"
+       _test_mount "-o ${options[$i]}" >> $seqres.full 2>&1
+       echo $?
+       _test_unmount >> $seqres.full 2>&1
+done
+
+status=0
+exit
diff --git a/tests/f2fs/017.out b/tests/f2fs/017.out
new file mode 100644 (file)
index 0000000..c260e0b
--- /dev/null
@@ -0,0 +1,21 @@
+QA output created by 017
+Option#0: background_gc=on : blkzone
+0
+Option#2: background_gc=off : blkzone
+32
+Option#4: background_gc=sync : blkzone
+0
+Option#6: mode=adaptive : blkzone
+32
+Option#8: mode=lfs : blkzone
+0
+Option#10: mode=fragment:segment : blkzone
+32
+Option#12: mode=fragment:block : blkzone
+32
+Option#14: discard_unit=block : blkzone
+0
+Option#16: discard_unit=segment : blkzone
+0
+Option#18: discard_unit=section : blkzone
+0