]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/050: handle f2fs as nojournal filesystem
authorJan Prusakowski <jprusakowski@google.com>
Fri, 10 Apr 2026 13:18:20 +0000 (13:18 +0000)
committerZorro Lang <zlang@kernel.org>
Thu, 16 Apr 2026 16:48:18 +0000 (00:48 +0800)
F2FS uses a checkpoint mechanism for metadata consistency rather than a
traditional journal. Roll-forward recovery is only needed if there are
fsync'd files since the last checkpoint.

In this test case, files are created without fsync, so there is no
roll-forward data to replay during mount.

Therefore, F2FS does not need to write to the device to recover, and
successfully mounts on the read-only block device. Thus, it should be
treated as nojournal in this case.

Signed-off-by: Jan Prusakowski <jprusakowski@google.com>
Reviewed-by: Zorro Lang <zlang@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/050

index 3bc371756fd221efbbe078625e08eec7ba755a55..3a641a6586a442f72295dc7d5fb5423d3bec6d52 100755 (executable)
@@ -46,6 +46,18 @@ elif [ "$FSTYP" = "btrfs" ]; then
        # So for this test case, btrfs will not get any dirty log tree thus
        # it can be treated as "nojournal".
        features="nojournal"
+elif [ "$FSTYP" = "f2fs" ]; then
+       # F2FS uses a checkpoint mechanism for metadata consistency rather than a
+       # traditional journal. Roll-forward recovery is only needed if there are
+       # fsync'd files since the last checkpoint.
+       #
+       # In this test case, files are created without fsync, so there is no
+       # roll-forward data to replay during mount.
+       #
+       # Therefore, F2FS does not need to write to the device to recover, and
+       # successfully mounts on the read-only block device. Thus, it should be
+       # treated as "nojournal" in this case.
+       features="nojournal"
 fi
 _link_out_file "$features"