|
|
Log in / Subscribe / Register

Kernel prepatch 7.3-rc7

The 7.3-rc7 kernel prepatch is out for testing. According to Linus: "As always, I would have preferred to see a smaller rc, but it's not like anything in here looks like a reason to delay the final release. So that's still set for next weekend unless something new comes up."

One notable change that slipped into the mainline this week is the deprecation of the ext4 data=journal mode; it will be removed entirely at the beginning of 2028.


to post comments

ext4 data=journal deprecation?

Posted Oct 12, 2026 7:48 UTC (Mon) by cthart (guest, #4457) [Link] (1 responses)

What is the implication of deprecation of the ext4 data=journal mode?

ext4 data=journal deprecation?

Posted Oct 12, 2026 11:32 UTC (Mon) by malmedal (subscriber, #56172) [Link]

I relied on that feature when I had a machine that would lock up randomly, the other modes would lose data, but never with data-journaling as far as I could detect. (Yes, I know, replace bad hardware)

data=journal

Posted Oct 12, 2026 11:57 UTC (Mon) by epa (subscriber, #39769) [Link] (15 responses)

I remember when data=journal was introduced. It was liberating since I could just flip the power switch on my computer without formally shutting down. Anything reported as being saved had been saved permanently. (This was when PCs still had physical power switches.) And on a spinning disk, write performance wasn't noticeably slower.

If you still want that property in 2026, what are your options?

data=journal

Posted Oct 12, 2026 13:39 UTC (Mon) by hmh (subscriber, #3838) [Link] (7 responses)

IME Super capacitor SSDs (datacenter class), or battery backed RAID (YMMV). And you should still avoid it like the plague.

Not that Dell UEFI that power-cycles the machine on every firmware update *without* doing the correct nvme dance to quiesce SSDs won't force you to do it somewhat often, anyway (modern workstations, the servers might or might not do the right thing).

data=journal

Posted Oct 12, 2026 13:42 UTC (Mon) by hmh (subscriber, #3838) [Link] (6 responses)

Sorry, posted an incomplete answer. It won't help if the filesystem is not operating in slow mode with write barriers and data flushing, ext4 in journal mode was good at that.

Can't trust most apps to fsync() everything needed...

data=journal

Posted Oct 12, 2026 14:00 UTC (Mon) by epa (subscriber, #39769) [Link] (5 responses)

Yes, that's what I am asking. How can I run my Linux box in such a mode that whenever a write is reported to userspace as completed, the data is on permanent storage, and will not be lost on power failure? Let's assume that I trust the hard disk itself to record writes durably (which as you say may require enterprise-grade SSDs rather than consumer ones).

There might be a way to turn off write-back caching altogether, but performance would really suck. data=journal is a nice speedup, viewed in those terms. Are there other journalling filesystems that support such a mode?

data=journal

Posted Oct 12, 2026 14:19 UTC (Mon) by joib (subscriber, #8541) [Link]

The "sync" mount option might do roughly what you want. It's going to be slow, as you mention.

FWIW, AFAIU data=journal didn't guarantee that a completed write was on stable storage either.

Maybe you could make a daemon that runs sync() every few seconds, that might get you closer?

data=journal

Posted Oct 12, 2026 14:28 UTC (Mon) by andresfreund (subscriber, #69562) [Link]

> Yes, that's what I am asking. How can I run my Linux box in such a mode that whenever a write is reported to userspace as completed, the data is on permanent storage, and will not be lost on power failure?

I think you could mount with sync option. Performance will be terrible, your storage devices will live a lot shorter, but you get what you asked for.

FWIW, I think that's a different guarantee than what data=journal gives you. I don't think data=journal guarantees what you're asking for here. data=journal to my knowledge does *not* trigger a journal flush before returning to userspace. It think it does guarantee that, if you mix metadata (rename, unlink, etc) and data operations, you will get a state after journal replay that's similar to one that actually existed before the crash.

> There might be a way to turn off write-back caching altogether, but performance would really suck.

I am confused - what form of write back caching would be allowed for a useful timeframe with the mode you described?

data=journal

Posted Oct 12, 2026 15:12 UTC (Mon) by intelfx (subscriber, #130118) [Link] (2 responses)

Yes, that's what I am asking. How can I run my Linux box in such a mode that whenever a write is reported to userspace as completed, the data is on permanent storage, and will not be lost on power failure? Let's assume that I trust the hard disk itself to record writes durably (which as you say may require enterprise-grade SSDs rather than consumer ones).

There might be a way to turn off write-back caching altogether, but performance would really suck. data=journal is a nice speedup, viewed in those terms. Are there other journalling filesystems that support such a mode?

I don't think data=journal has the effect you desire in the first place. Nothing except -o sync (which is exactly "turning off write-back caching altogether") has the property of having each write() in durable storage by the time the write is reported to userspace as completed (i.e., at the point of return from the write() syscall). These two clauses are different spelling of the same requirements, and neither -o data=journal nor better transactional filesystems would do that for you.

In other words, "I want all writes on durable storage by default" and "The performance of having all writes on durable storage by default would really suck" are inherently contradictory requirements.

The only way to have critical writes committed to durable storage without having all writes always implicitly committed to durable storage by default is by virtue of marking which writes are critical and which are not. A.K.A. fsync()/fdatasync().

Intermediate between all writes to durable storage, and using `fsync()`

Posted Oct 12, 2026 15:45 UTC (Mon) by farnz (subscriber, #17727) [Link] (1 responses)

Note, though, that there's at least one intermediate option between "all writes are on durable storage by default" (the sync mount option) and "no writes are on durable storage, unless sync()/syncfs()/fsync()/fdatasync() are used to make them safe" (the default async mount option) - Linux's FAT support has the flush mount option, which lets writes accumulate in caches (like async), but puts implicit syncfs() calls in for you on close.

That is often a "good enough" approximation to "all writes are on permanent storage when the write is reported to userspace as completed", since often what people mean by that is "when my application says my work is saved, it is on the durable medium", and applications usually close() your work after saving it, rather than keeping the file open. Those that don't tend to have fsync() calls in place already, because otherwise opening the file in another application gets confusing.

Intermediate between all writes to durable storage, and using `fsync()`

Posted Oct 12, 2026 17:07 UTC (Mon) by hmh (subscriber, #3838) [Link]

fsync() is relatively easy to find on applications, what usually causes trouble is the need to also fsync() the parent directory. That's one hell of a troublemaker and an extremely bad pattern to ask of userspace.

Mount/filesystem options that include an implicit sync of all the data and metadata relevant to a writeable file being closed/renamed/etc are a godsend to greatly reduce the chances of data loss on power loss or disconnection without previous notice.

data=journal

Posted Oct 12, 2026 15:05 UTC (Mon) by Wol (subscriber, #4433) [Link] (3 responses)

Maybe it's the only mode nowadays?

For those who remember their history, it was the default (by accident) in ext3. It was then changed in ext4 for a "better" version. I don't remember the argument, but I think it was the devs prioritising the disk metadata over the user data. Or the new version squeezed that little bit extra performance. Whatever, the problem was the new variant had the unfortunate side effect that - if the computer crashed - along with the "before" and "after" state specified by Posix, you could also see a "whatever's that" (usually an empty file) state caused by the metadata change being journaled before the user data was journaled or written.

According to the nasal daemon brigade, this isn't a Posix violation because Posix doesn't account for system crashes.

So if it has been changed to be the only mode, that's a big step forward. Can anybody confirm that this actually is the case?

Cheers,
Wol

data=journal

Posted Oct 12, 2026 15:25 UTC (Mon) by intelfx (subscriber, #130118) [Link] (2 responses)

Maybe it's the only mode nowadays?

For those who remember their history, it was the default (by accident) in ext3. It was then changed in ext4 for a "better" version. I don't remember the argument, but I think it was the devs prioritising the disk metadata over the user data. Or the new version squeezed that little bit extra performance. Whatever, the problem was the new variant had the unfortunate side effect that - if the computer crashed - along with the "before" and "after" state specified by Posix, you could also see a "whatever's that" (usually an empty file) state caused by the metadata change being journaled before the user data was journaled or written.

<...>

So if it has been changed to be the only mode, that's a big step forward. Can anybody confirm that this actually is the case?

No, it's neither. What you describe is -o data=writeback: metadata is journaled, data is written out directly to the filesystem after that. If the system crashes after metadata journaling but before data writeout, upon crash recovery you will see a file with updated metadata (e.g., extended size) but "whatever's that" in place of the data that was not written. This mode is not the default.

The default mode right now is not an equivalent of -o data=journal, but -o data=ordered: data is written out directly to the filesystem, then metadata is journaled. In this case, if the system crashes at any point before metadata was logged, then you will have some bytes of data written into some not-yet-allocated space, i.e. you will observe the state of the filesystem as if the write did not happen.

The only potential problem here is during an overwrite operation: e.g. you have a 10M file, and you write another 10M at offset 5M (implicitly extending the file by another 5M): then it is possible for you to see that the first 5M (within the old size of the file) has been written out, but the size of the file has not been updated. I.e. overwrite operations may be "torn".

But if you (or your program) care about data consistency, then it will write a new file, fsync it, and then atomically swap the new file with the old one. Anything else would be broken with pretty much any Linux filesystem, because Linux VFS semantics do not have a notion of a transaction that spans multiple syscalls (even if the filesystem is transactional by itself, like btrfs/bcachefs/zfs).

data=journal

Posted Oct 12, 2026 18:44 UTC (Mon) by Wol (subscriber, #4433) [Link] (1 responses)

> The default mode right now is not an equivalent of -o data=journal, but -o data=ordered: data is written out directly to the filesystem, then metadata is journaled. In this case, if the system crashes at any point before metadata was logged, then you will have some bytes of data written into some not-yet-allocated space, i.e. you will observe the state of the filesystem as if the write did not happen.

Ah. So I didn't remember the detail correctly.

> The only potential problem here is during an overwrite operation: e.g. you have a 10M file, and you write another 10M at offset 5M (implicitly extending the file by another 5M): then it is possible for you to see that the first 5M (within the old size of the file) has been written out, but the size of the file has not been updated. I.e. overwrite operations may be "torn".

Can't that be fixed in the file system? Okay, this would lead to fragmentation, but you never actually overwrite the live data on disk in this mode. You flush the writes into empty extents, update the metadata, and flush that to the journal. So the file system will do the equivalent of "fsync and swap". Basically trading a little read speed (on rotating rust) for increased integrity.

I guess if that mode is available, that's the equivalent of data=journal, but saves a second write. For SSDs (and shingling) that would be a quite a win!

Cheers,
Wol

data=journal

Posted Oct 12, 2026 20:16 UTC (Mon) by intelfx (subscriber, #130118) [Link]

Can't that be fixed in the file system? Okay, this would lead to fragmentation, but you never actually overwrite the live data on disk in this mode. You flush the writes into empty extents, update the metadata, and flush that to the journal. So the file system will do the equivalent of "fsync and swap". Basically trading a little read speed (on rotating rust) for increased integrity.

Yeah, that's called copy-on-write (or, if we're being pedantic, redirect-on-write), and that's how all the new filesystems work ;)

(Well, except that btrfs, as I've been just reminded, for some reason implements the worst of both worlds by default)

data=journal

Posted Oct 12, 2026 15:06 UTC (Mon) by intelfx (subscriber, #130118) [Link] (2 responses)

If you still want that property in 2026, what are your options?

Any other truly transactional filesystem (btrfs, bcachefs, zfs).

btrfs flushoncommit

Posted Oct 12, 2026 15:40 UTC (Mon) by jbosboom (guest, #176381) [Link] (1 responses)

For btrfs, you need to use the flushoncommit mount option, or crashes can result in holes in the middle of files (in addition to crashes leaving empty files). fsync itself also breaks write ordering when the log tree is enabled (intentionally, that's what it's for). If it really matters to you, I recommend reading this comment about flushoncommit and this issue regarding the log tree/fsync from the GitHub repo of bees, a btrfs deduplication program. bees's author has a deep understanding of btrfs, including its weaknesses.

btrfs flushoncommit

Posted Oct 12, 2026 18:18 UTC (Mon) by intelfx (subscriber, #130118) [Link]

For btrfs, you need to use the flushoncommit mount option, or crashes can result in holes in the middle of files (in addition to crashes leaving empty files). fsync itself also breaks write ordering when the log tree is enabled (intentionally, that's what it's for).

Right. I've entirely forgotten the entire flushoncommit saga — so, with btrfs' default -o noflushoncommit, the behavior is not transactional wrt. data, and indeed most closely resembles -o data=writeback (i.e. entirely unsafe) than anything else.

ext4: mark data=journal as deprecated and will be removed in January 2028.

Posted Oct 13, 2026 15:16 UTC (Tue) by geert (subscriber, #98403) [Link]

Commit 3e78d7b063230d39 ("ext4: mark data=journal as deprecated and will be removed in January 2028.") lacks a proper description, obviously missing the "why?" part.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds