Files
Mykhaylo Sul d31af63df1 erofs: add fsync_on_commit to sync a layer before its commit
The metadata store fsyncs itself on commit, but nothing fsyncs
layer.erofs or the snapshot directory first. Lose power at the wrong
moment and you end up with a committed snapshot pointing at a truncated
blob, or at a directory that never made it to disk. Nothing recovers
from that: the chain ID is already there, so the next pull is a no-op
and the image simply fails to mount.

Add an opt-in fsync_on_commit. When set, Commit fsyncs the snapshot
directory and what's in it before recording the snapshot. Off by
default: it costs a few fsyncs per layer, and not everyone needs it.

Backport of #14334 and #14378.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Mykhaylo Sul <mykhaylo.sul@oss.qualcomm.com>
(cherry picked from commit d0ed8ab2a)
(cherry picked from commit 8f3aafa29)
2026-10-15 16:46:35 +02:00
..
2023-12-09 13:09:39 -08:00
2018-12-20 10:01:51 +01:00
2022-04-05 16:41:54 +09:00
2025-08-22 13:11:15 +03:00
2024-11-28 12:13:07 +01:00
2026-04-20 14:46:50 -07:00