This topic describes how to avoid the risk of data corruption on ext4 file systems that are created in nojournal mode on Alibaba Cloud Linux 3 and Alibaba Cloud Linux 4 operating systems.
All versions of Alibaba Cloud Linux create ext4 file systems in journal mode by default. Therefore, you are not affected by this issue unless you explicitly disable the journal during formatting (mkfs.ext4 -O ^has_journal).
Background
On Alibaba Cloud Linux 3, which is based on the Linux 5.10 kernel, and Alibaba Cloud Linux 4, which is based on the Linux 6.6 kernel, a risk of data corruption exists when an ext4 file system is formatted in nojournal mode (mkfs.ext4 -O ^has_journal) and the following conditions are met:
Files are frequently created and deleted. This leads to frequent allocation, reclamation, and reallocation of disk space.
The system performs frequent memory reclamation operations.
The ext4 file system uses nojournal mode. This means the journal feature is explicitly disabled during formatting.
Cause
In nojournal mode, a metadata block on the disk might be released but not yet written to persistent storage. If that same block is then allocated to a new file, an I/O race condition can occur when a dirty page write-back is triggered. This race condition can lead to unexpected persistence results and cause data corruption.
This issue was introduced in the community Linux 5.1 kernel, which was released in 2019. On September 11, 2025, Alibaba Cloud performed a root cause analysis, reported the issue to the community, and confirmed it with the original author. The issue also exists in the mainline community kernel. A community fix is currently under discussion.
Solutions
Like many niche ext4 features, nojournal mode is not widely deployed in general-purpose storage scenarios and lacks sufficient reliability testing. In production environments that require data integrity, do not use the nojournal mode for ext4.
If you already use an ext4 file system created in nojournal mode, reformat the file system and use the default parameters to enable the journal. If you use non-default parameters, carefully evaluate the stability risks.
Affected distributions
This issue affects all distributions that use Linux kernel 5.1 or later. Affected distributions include the following:
Alibaba Cloud Linux 3 (Linux 5.10 kernel)
Alibaba Cloud Linux 4 (Linux 6.6 kernel)
Ubuntu 20.04 LTS (Linux 5.4 kernel)
Ubuntu 22.04 LTS (Linux 5.15 kernel)
Ubuntu 24.04 LTS (Linux 6.8 kernel)