Skip to contentSkip to conversation

generic: adjust strict SPO recovery testcases for f2fs

PATCH In review Chao Yu 2 participants 3 messages May 21, 2022 – May 31, 2022

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 generic: adjust strict SPO recovery testcases for f2fs

Testcases like generic 342/502/526/527 expect that filesystems will recover all related metadata changes to the file which was fsynced before sudden power off.

This patch adjusts to use "fsync_mode=strict" mountoption for f2fs to pass these testcases.

---
 tests/generic/342 | 5 +++++
 tests/generic/502 | 5 +++++
 tests/generic/526 | 5 +++++
 tests/generic/527 | 5 +++++
 4 files changed, 20 insertions(+)
tests/generic/342 +5 -0
index 676b876b..cdffaaf3 100755
@@ -31,6 +31,11 @@ _require_dm_target flakey
 
 _scratch_mkfs >>$seqres.full 2>&1
 _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
 _init_flakey
 _mount_flakey
 
tests/generic/502 +5 -0
index b0f9077f..b5589b81 100755
@@ -34,6 +34,11 @@ _require_dm_target flakey
 
 _scratch_mkfs >>$seqres.full 2>&1
 _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
 _init_flakey
 _mount_flakey
 
tests/generic/526 +5 -0
index dc7cb36c..ada4dbee 100755
@@ -32,6 +32,11 @@ _require_dm_target flakey
 
 _scratch_mkfs >>$seqres.full 2>&1
 _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
 _init_flakey
 _mount_flakey
 
tests/generic/527 +5 -0
index 40cd1c6a..de09d171 100755
@@ -32,6 +32,11 @@ _require_dm_target flakey
 
 _scratch_mkfs >>$seqres.full 2>&1
 _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
 _init_flakey
 _mount_flakey
 
Signature · 1 line
2.25.1
author
#1 lore raw

+Cc Zorro,

Any comments?

Quoted 79 lines · Chao Yu

Testcases like generic 342/502/526/527 expect that filesystems will recover all related metadata changes to the file which was fsynced before sudden power off.

This patch adjusts to use "fsync_mode=strict" mountoption for f2fs to pass these testcases.

---
  tests/generic/342 | 5 +++++
  tests/generic/502 | 5 +++++
  tests/generic/526 | 5 +++++
  tests/generic/527 | 5 +++++
  4 files changed, 20 insertions(+)
tests/generic/342 +5 -0
index 676b876b..cdffaaf3 100755
@@ -31,6 +31,11 @@ _require_dm_target flakey
 
  _scratch_mkfs >>$seqres.full 2>&1
  _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
  _init_flakey
  _mount_flakey
 
tests/generic/502 +5 -0
index b0f9077f..b5589b81 100755
@@ -34,6 +34,11 @@ _require_dm_target flakey
 
  _scratch_mkfs >>$seqres.full 2>&1
  _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
  _init_flakey
  _mount_flakey
 
tests/generic/526 +5 -0
index dc7cb36c..ada4dbee 100755
@@ -32,6 +32,11 @@ _require_dm_target flakey
 
  _scratch_mkfs >>$seqres.full 2>&1
  _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
  _init_flakey
  _mount_flakey
 
tests/generic/527 +5 -0
index 40cd1c6a..de09d171 100755
@@ -32,6 +32,11 @@ _require_dm_target flakey
 
  _scratch_mkfs >>$seqres.full 2>&1
  _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
  _init_flakey
  _mount_flakey
 
Reviewed-by on v1 1/1
#2 lore raw
In reply to Chao Yu
Quoted 9 lines · Chao Yu

Testcases like generic 342/502/526/527 expect that filesystems will recover all related metadata changes to the file which was fsynced before sudden power off.

This patch adjusts to use "fsync_mode=strict" mountoption for f2fs to pass these testcases.

---

I don't have better idea, so it's good to me.

I'm thinking about is there only f2fs has this kind of requirement? If this's not a single problem, we can help a common helper for that. But if only f2fs, I think this change is fine.

Welcome better ideas if anyone else has. If no more, I'll merge it.

Thanks,
Zorro

Quoted 73 lines
 tests/generic/342 | 5 +++++
 tests/generic/502 | 5 +++++
 tests/generic/526 | 5 +++++
 tests/generic/527 | 5 +++++
 4 files changed, 20 insertions(+)
tests/generic/342 +5 -0
index 676b876b..cdffaaf3 100755
@@ -31,6 +31,11 @@ _require_dm_target flakey
 
 _scratch_mkfs >>$seqres.full 2>&1
 _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
 _init_flakey
 _mount_flakey
 
tests/generic/502 +5 -0
index b0f9077f..b5589b81 100755
@@ -34,6 +34,11 @@ _require_dm_target flakey
 
 _scratch_mkfs >>$seqres.full 2>&1
 _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
 _init_flakey
 _mount_flakey
 
tests/generic/526 +5 -0
index dc7cb36c..ada4dbee 100755
@@ -32,6 +32,11 @@ _require_dm_target flakey
 
 _scratch_mkfs >>$seqres.full 2>&1
 _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
 _init_flakey
 _mount_flakey
 
tests/generic/527 +5 -0
index 40cd1c6a..de09d171 100755
@@ -32,6 +32,11 @@ _require_dm_target flakey
 
 _scratch_mkfs >>$seqres.full 2>&1
 _require_metadata_journaling $SCRATCH_DEV
+
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
+
 _init_flakey
 _mount_flakey
 
Signature · 1 line
2.25.1