On Sat, Nov 12, 2022 at 01:39:56PM -0500, Stefan Monnier wrote:
But as I mentioned, higher-layers (the filesystem layer, and the
applications running on top of that) *should* try and make sure that
a hard failure (kernel crash, power failure, ... these and up taking
a snapshot of your block device) can never result in an
inconsistent state.
That's the core of the ext3 improvement over ext2, for example.
Actually, it isn't--the core of ext3 improvement over ext2 is faster
startup time after an unplanned shutdown, by avoiding a fsck; it does
not offer stronger consistency guarantees than ext2 if the application
is being careful in how it writes data. It's possible to run ext3 in
full data journalling mode, which does change things, but that isn't
normally done because the performance impact is significant. (And
because in most cases it doesn't help much in practice--applications
that are careful about how they write data already cope with
non-data-journaling filesystems because that's the normal case, and
applications which aren't careful about how they write data can still
end up in a situation where data is consistent from the filesystem pov
but partially written/corrupt from the application pov.)