Skip to contentSkip to conversation

f2fs/015: clear MKFS_OPTIONS and MOUNT_OPTIONS

PATCH In review Joanne Chang 3 participants 8 messages Nov 12, 2025 – Nov 15, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 f2fs/015: clear MKFS_OPTIONS and MOUNT_OPTIONS

Currently, residual options can interfere with checking the mount behavior of the listed MKFS_OPTIONS and MOUNT_OPTIONS. For example, "Option#120: test_dummy_encryption" should fail with the listed options but succeeds if “MKFS_OPTIONS=encrypt” is preset. By explicitly clearing MKFS_OPTIONS and MOUNT_OPTIONS, the test’s reliability can be improved.

f2fs/015.out is also updated to expect failure for cases that require additional mkfs attributes to mount.

---
 tests/f2fs/015     | 3 +++
 tests/f2fs/015.out | 8 ++++----
 2 files changed, 7 insertions(+), 4 deletions(-)
tests/f2fs/015 +3 -0
index 73ac3d82..6a7a582c 100755
@@ -103,6 +103,9 @@ options=(
 	"norecovery,ro"			""			\
 )
 
+# remove all mkfs/mount options to avoid affecting results
+export MKFS_OPTIONS=""
+export MOUNT_OPTIONS=""
 for ((i=0;i<${#options[@]};i=i+2))
 do
 	echo "Option#$i: ${options[$i]} : ${options[$((i+1))]}"
tests/f2fs/015.out +4 -4
index 8d6712f0..3df29436 100644
@@ -38,7 +38,7 @@ Option#34: inline_xattr :
 Option#36: noinline_xattr : 
 0
 Option#38: inline_xattr_size=400 : 
-0
+32
 Option#40: inline_data : 
 0
 Option#42: noinline_dentry : 
@@ -120,11 +120,11 @@ Option#116: fsync_mode=strict :
 Option#118: fsync_mode=nobarrier : 
 0
 Option#120: test_dummy_encryption : 
-0
+32
 Option#122: test_dummy_encryption=v1 : 
-0
+32
 Option#124: test_dummy_encryption=v2 : 
-0
+32
 Option#126: checkpoint=enable : 
 0
 Option#128: checkpoint=disable : 
Signature · 1 line
2.51.2.1041.gc1ab5b90ca-goog
#1 lore raw

PATCH 2/3 f2fs/016: add test cases for test_dummy_encryption mount option

Add test cases to verify f2fs's support for different versions of the "test_dummy_encryption" mount option.

To ensure test robustness, the MKFS_OPTIONS and MOUNT_OPTIONS are cleared. This prevents additional options from interfereing with the test results.

---
 tests/f2fs/016     | 6 ++++++
 tests/f2fs/016.out | 6 ++++++
 2 files changed, 12 insertions(+)
tests/f2fs/016 +6 -0
index 800f75fc..a6df827d 100755
@@ -35,8 +35,14 @@ options=(
 	"compress_mode=fs"		"extra_attr,compression"	\
 	"compress_mode=user"		"extra_attr,compression"	\
 	"compress_cache"		"extra_attr,compression"	\
+	"test_dummy_encryption"		"encrypt"					\
+	"test_dummy_encryption=v1"	"encrypt"					\
+	"test_dummy_encryption=v2"	"encrypt"					\
 )
 
+# remove all mkfs/mount options to avoid affecting results
+export MKFS_OPTIONS=""
+export MOUNT_OPTIONS=""
 for ((i=0;i<${#options[@]};i=i+2))
 do
 	echo "Option#$i: ${options[$i]} : ${options[$((i+1))]}"
tests/f2fs/016.out +6 -0
index a8c96972..5ff116a7 100644
@@ -31,3 +31,9 @@ Option#28: compress_mode=user : extra_attr,compression
 0
 Option#30: compress_cache : extra_attr,compression
 0
+Option#32: test_dummy_encryption : encrypt
+0
+Option#34: test_dummy_encryption=v1 : encrypt
+0
+Option#36: test_dummy_encryption=v2 : encrypt
+0
Signature · 1 line
2.51.2.1041.gc1ab5b90ca-goog
#2 lore raw

Re: [PATCH v1 2/3] f2fs/016: add test cases for test_dummy_encryption mount option

Quoted 8 lines · Joanne Chang

Add test cases to verify f2fs's support for different versions of the "test_dummy_encryption" mount option.

To ensure test robustness, the MKFS_OPTIONS and MOUNT_OPTIONS are cleared. This prevents additional options from interfereing with the test results.

To Zorro,

The changes look good to me, though, still I want to confirm that whether it is recommended or not to add new cases in old testcase.

Thanks,

Reviewed-by
#3 lore raw

Re: [PATCH v1 2/3] f2fs/016: add test cases for test_dummy_encryption mount option

Quoted 8 lines · Chao Yu
Quoted 7 lines · Joanne Chang

Add test cases to verify f2fs's support for different versions of the "test_dummy_encryption" mount option.

To ensure test robustness, the MKFS_OPTIONS and MOUNT_OPTIONS are cleared. This prevents additional options from interfereing with the test results.

Quoted 6 lines
Quoted 1 line

To Zorro,

The changes look good to me, though, still I want to confirm that whether it is recommended or not to add new cases in old testcase.

Hi Chao,

I think this case isn't a regression test to uncover a known bug, it's a basic mount options test for f2fs. So that makes sense to me to add "test_dummy_encryption" into f2fs/016, especially if it doesn't need to bring in more _require_* restriction (right?) .

Thanks,
Zorro

Quoted 3 lines

Thanks,

Reviewed-by
#4 lore raw

Re: [PATCH v1 2/3] f2fs/016: add test cases for test_dummy_encryption mount option

Quoted 16 lines · Zorro Lang
Quoted 8 lines · Chao Yu
Quoted 7 lines · Joanne Chang

Add test cases to verify f2fs's support for different versions of the "test_dummy_encryption" mount option.

To ensure test robustness, the MKFS_OPTIONS and MOUNT_OPTIONS are cleared. This prevents additional options from interfereing with the test results.

Quoted 6 lines
Quoted 1 line

To Zorro,

The changes look good to me, though, still I want to confirm that whether it is recommended or not to add new cases in old testcase.

Quoted 6 lines

Hi Chao,

I think this case isn't a regression test to uncover a known bug, it's a basic mount options test for f2fs. So that makes sense to me to add "test_dummy_encryption" into f2fs/016, especially if it doesn't need to bring in more _require_* restriction (right?) .

Zorro,

Thanks for the confirmation, I agree w/ that.

Thanks,

Quoted 10 lines

Thanks,
Zorro

Quoted 3 lines

Thanks,

#5 lore raw

PATCH 3/3 f2fs/{019,020}: clear MOUNT_OPTIONS alongside MKFS_OPTIONS

In reply to Joanne Chang

Currently, f2fs/019 and f2fs/020 only clears MKFS_OPTIONS. This causes the tests to fail when leftover MOUNT_OPTIONS depend on unapplied MKFS_OPTIONS. So MOUNT_OPTIONS should also be cleared to ensure reliable mounting.

---
 tests/f2fs/019 | 1 +
 tests/f2fs/020 | 1 +
 2 files changed, 2 insertions(+)
tests/f2fs/019 +1 -0
index a6e6e38c..721f2180 100755
@@ -22,6 +22,7 @@ _require_inject_f2fs_command node addr
 
 # remove all mkfs options to avoid layout change of on-disk inode
 export MKFS_OPTIONS=""
+export MOUNT_OPTIONS=""
 
 testfile=$SCRATCH_MNT/testfile
 
tests/f2fs/020 +1 -0
index a6933134..eecd312d 100755
@@ -25,6 +25,7 @@ _require_attrs user
 
 # remove all mkfs options to avoid layout change of on-disk inode
 export MKFS_OPTIONS=""
+export MOUNT_OPTIONS=""
 
 testdir=$SCRATCH_MNT/testdir
 
Signature · 1 line
2.51.2.1041.gc1ab5b90ca-goog
Reviewed-by on v1 3/3
#6 lore raw

Re: [PATCH v1 3/3] f2fs/{019,020}: clear MOUNT_OPTIONS alongside MKFS_OPTIONS

Quoted 6 lines · Joanne Chang

Currently, f2fs/019 and f2fs/020 only clears MKFS_OPTIONS. This causes the tests to fail when leftover MOUNT_OPTIONS depend on unapplied MKFS_OPTIONS. So MOUNT_OPTIONS should also be cleared to ensure reliable mounting.

Thanks,

Reviewed-by on v1 1/3
#7 lore raw
In reply to Joanne Chang
Quoted 11 lines · Joanne Chang

Currently, residual options can interfere with checking the mount behavior of the listed MKFS_OPTIONS and MOUNT_OPTIONS. For example, "Option#120: test_dummy_encryption" should fail with the listed options but succeeds if “MKFS_OPTIONS=encrypt” is preset. By explicitly clearing MKFS_OPTIONS and MOUNT_OPTIONS, the test’s reliability can be improved.

f2fs/015.out is also updated to expect failure for cases that require additional mkfs attributes to mount.

Thanks,