* Re: ext4 data=journal deprecation: long-standing industrial use case
[not found] <CAAbJaeALOrZwWs++mz9Wv0pfvyDoHmfzPKyVHR0v6TwnzLkYGw@mail.gmail.com>
@ 2026-10-12 18:53 ` Theodore Tso
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Tso @ 2026-10-12 18:53 UTC (permalink / raw)
To: Gabriele Moabiti; +Cc: linux-ext4
On Mon, Oct 12, 2026 at 03:41:29PM -0500, Gabriele Moabiti wrote:
>
> In these deployments, we have not experienced problems with this
> configuration over those 15 years. It has been a reliable solution for our
> operating conditions.
> I understand that data=journal is deprecated and scheduled for removal in
> January 2028. Given this established industrial use case, could the
> decision be reconsidered, perhaps retaining full data journaling as an
> optional feature?
The challenge with data=journal is that it adds a lot of complexity,
and more and more of the advanced featuers are simply "turned off" and
the original code path is used for data=journal --- and the "original
code path" is only used by the data=journal case. This has the
following of undesireable outcomes:
* Extra code paths == extra maintenance overhead
* The data=journal specific codepaths are getting much less testing
* There are known test failures with data=journal which are not
getting addressed. (n.b. If paying customers were supporting with $$$
the SWE investment of data=journal this could be better addressed, but
at the moment data=journal is essentially best efforts by volunteers.)
> If removal goes ahead, will ext4 provide an alternative with equivalent
> protection against interrupted data writes and abrupt power loss? In
> particular, I would appreciate clarification on how users relying on full
> data journaling are expected to preserve comparable guarantees within ext4.
The phrase "comparable guarantees" is not particularly well defined, because...
> I understand that data=journal does not make application-level updates
> atomic or preserve data still buffered in userspace. Nevertheless, its
> protection beyond metadata-only journaling is valuable for our deployments.
Given that there is no guarantees of what writes will be persisted
with respect to program execution, it's unclear exactly what your
deployments are requiring or assuming.
That being said, I *suspect* that this should cover most, if not all
of your deployments' requirements.
echo 500 > /proc/sys/vm/dirty_expire_centisecs
echo 100 > /proc/sys/vm/dirty_writeback_centisecs
To make these changes persistent after a reboot, put the following in
/etc/sysctl.conf, or in a file in /etc/sysctl.d/
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
What these changes will do is if there are any dirty pages, writeback
will be initiated after 5 seconds (vm.dirty_expire_centisecs) and the
writeback flusher kernel threads will wake up once a second
(vm.dirty_writeback_centisecs).
The default values of these two settings are 30 seconds (3000) and 5
seconds (500), respectively. By default, ext4 uses a commit time of 5
seconds (mount option commit=300). In data=journal mode, when we
close an jbd2 journal commit, we effectively force data to be
persisted after a crash. So by setting vm.dirty_expire_centisecs to
500, this will have roughly the same effect --- which is to say, after
a write first dirties a page, that page will be persisted after 5
seconds.
If the application wants a guarantee that a write is persisted, it
should use fsync(2). But if you don't want to modify the application,
the window between when the application writes a file to when the data
is persisted can be reduced from 30 seconds to 5 seconds either by
using data=journal *or* setting dirty_expire_centisecs.
There will be some slight differences in behavior, but given that
data=journal doesn't have any real guarantees ---- if you want those
guarantees, using fsync(2) or fdatasync(2), hopefully it should be
good enough. You may also find that performance may be improved by
using dirty_expire_centisecs if you are bottlenecked by the storage
device's I/O throughput limits, and it will also reduce flash write
endurance impacts (and hence improve SSD lifetime) if you are using
flash storage.
Can you give it a try and see if it works for you?
> We would prefer to continue using a normally writable ext4 filesystem,
> without introducing an overlay or migrating to another filesystem.
Note that no other file system has anything like data=journal, so
introducing an overlay (not sure what you mean by that) or migrating
to another file system is not likely to help you.
Cheers,
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread