Skip to contentSkip to conversation

generic/066: attr1 is still there after log replay on f2fs

PATCH Superseded Sun Ke 2 participants 3 messages Mar 11, 2022 – Mar 15, 2022

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Sun Ke

author
#0 lore raw

PATCH v2 1/1 generic/066: attr1 is still there after log replay on f2fs

The test fail on f2fs:
xattr names and values after second fsync log replay:
# file: SCRATCH_MNT/foobar
+user.attr1="val1"
user.attr3="val3"

attr1 is still there after log replay. f2fs doesn't support fs-op level transaction functionality. so it have no way to persist all metadata updates in one transaction. We can use "fastboot" mountoption for this case, so during last fsync on qwerty, f2fs can trigger a checkpoint which will persist all metadata updates before fsync().

---
 tests/generic/066 | 8 ++++++++
 1 file changed, 8 insertions(+)
tests/generic/066 +8 -0
index 105a7acd..b8465101 100755
@@ -56,6 +56,14 @@ sync
 $SETFATTR_PROG -x user.attr2 $SCRATCH_MNT/foobar
 $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foobar
 
+# f2fs doesn't support fs-op level transaction functionality. so it have no way
+# to persist all metadata updates in one transaction.  We can use "fastboot"
+# mountoption for this case, so during last fsync on qwerty, f2fs can trigger a
+# checkpoint which will persist all metadata updates before fsync().
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fastboot"
+fi
+
 _flakey_drop_and_remount
 
 # After the fsync log is replayed, the file should have only 2 xattrs, the ones
Signature · 1 line
2.13.6
#1 lore raw
Quoted 23 lines · On 2022/3/11 17:43, Sun Ke via Linux-f2fs-devel wrote:

The test fail on f2fs:
xattr names and values after second fsync log replay:
# file: SCRATCH_MNT/foobar
+user.attr1="val1"
user.attr3="val3"

attr1 is still there after log replay. f2fs doesn't support fs-op level transaction functionality. so it have no way to persist all metadata updates in one transaction. We can use "fastboot" mountoption for this case, so during last fsync on qwerty, f2fs can trigger a checkpoint which will persist all metadata updates before fsync().

---
  tests/generic/066 | 8 ++++++++
  1 file changed, 8 insertions(+)
tests/generic/066 +0 -0
index 105a7acd..b8465101 100755

tests/generic/066 sync · line 64

Quoted 9 lines
tests/generic/066 +6 -0
@@ -56,6 +56,14 @@ sync
  $SETFATTR_PROG -x user.attr2 $SCRATCH_MNT/foobar
  $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foobar
 
+# f2fs doesn't support fs-op level transaction functionality. so it have no way
+# to persist all metadata updates in one transaction.  We can use "fastboot"
+# mountoption for this case, so during last fsync on qwerty, f2fs can trigger a
+# checkpoint which will persist all metadata updates before fsync().
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fastboot"

Can we merge "fastboot" with original mount options? and after the test, how about recovering to original mount options?

Thanks,

Quoted 5 lines
tests/generic/066 +2 -0
+fi
+
  _flakey_drop_and_remount
 
  # After the fsync log is replayed, the file should have only 2 xattrs, the ones
author
#2 lore raw
Quoted 39 lines · Chao Yu
Quoted 31 lines · On 2022/3/11 17:43, Sun Ke via Linux-f2fs-devel wrote:

The test fail on f2fs:
      xattr names and values after second fsync log replay:
      # file: SCRATCH_MNT/foobar +user.attr1="val1"
      user.attr3="val3"

attr1 is still there after log replay. f2fs doesn't support fs-op level transaction functionality. so it have no way to persist all metadata updates in one transaction.  We can use "fastboot" mountoption for this case, so during last fsync on qwerty, f2fs can trigger a checkpoint which will persist all metadata updates before fsync().

---
  tests/generic/066 | 8 ++++++++

  1 file changed, 8 insertions(+)
tests/generic/066 +0 -0
index 105a7acd..b8465101 100755
@@ -56,6 +56,14 @@ sync

  $SETFATTR_PROG -x user.attr2 $SCRATCH_MNT/foobar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foobar
+# f2fs doesn't support fs-op level transaction functionality. so it have no way
+# to persist all metadata updates in one transaction.  We can use "fastboot"
+# mountoption for this case, so during last fsync on qwerty, f2fs can trigger a

tests/generic/066 sync · line 64

Quoted 3 lines
tests/generic/066 +3 -0
+# checkpoint which will persist all metadata updates before fsync().
+if [ $FSTYP = "f2fs" ]; then
+    export MOUNT_OPTIONS="-o fastboot"

Can we merge "fastboot" with original mount options? and after the test, how about recovering to original mount options?

Quoted 1 line

Thanks,

Like this:

if [ $FSTYP = "f2fs" ]; then
- export MOUNT_OPTIONS="-o fastboot"
+ export MOUNT_OPTIONS="-o fastboot $MOUNT_OPTIONS"
fi

right?

And I have tested that there is no need to recover to original mount options after the test. It will be the original one in the next test.

Thanks,
Sun Ke

Quoted 6 lines
Quoted 5 lines
tests/generic/066 +2 -0
+fi
+

  _flakey_drop_and_remount
  # After the fsync log is replayed, the file should have only 2 xattrs, the ones

.