Skip to contentSkip to conversation

generic/794: add fsync_mode=strict mount option for f2fs

PATCH In review Jan Prusakowski 2 participants 3 messages Oct 8

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/794: add fsync_mode=strict mount option for f2fs

generic/794 tests that extending a file past a non-block-aligned EOF correctly zero-fills the gap [old_EOF, block_boundary) both in memory and on disk, and that the zeroed data persists across a filesystem shutdown with metadata flush and subsequent remount.

On F2FS, kernel commit 5eced87b7d19 ("f2fs: fix to zero post-EOF data when extending file size") zeroes post-EOF data in the partial page and writes it back immediately before committing the updated i_size when mounted with "fsync_mode=strict".

Mount F2FS with "-o fsync_mode=strict" in generic/794, matching other strict crash-recovery tests (generic/342, generic/502, generic/526, and generic/527).

---
 tests/generic/794 | 3 +++
 1 file changed, 3 insertions(+)
tests/generic/794 +3 -0
index e10fb1f8..80be959a 100755
@@ -154,6 +154,9 @@ _test_eof_zeroing()
 }
 
 _scratch_mkfs >> $seqres.full 2>&1
+if [ $FSTYP = "f2fs" ]; then
+	export MOUNT_OPTIONS="-o fsync_mode=strict $MOUNT_OPTIONS"
+fi
 _scratch_mount
 
 blksz=$(_get_block_size $SCRATCH_MNT)
Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog
#1 lore raw

It looks like this sneaked into the other tests, but this option is bullshit and we should remove it from the other tests.

The f2fs default is simply broken, and the justification in the documentation is incorrect. f2fs should absolutely fail all these tests in default mode because it actually is broken.

#2 lore raw
Quoted 6 lines

It looks like this sneaked into the other tests, but this option is bullshit and we should remove it from the other tests.

The f2fs default is simply broken, and the justification in the documentation is incorrect. f2fs should absolutely fail all these tests in default mode because it actually is broken.

Hi Christoph, I can see your point. Let me look into it again.