Flaws have been found in the EXT4 filesystem that can cause data loss when running Linux 4.0 and higher.
Reports such as this Debian bug report suggest “massive filesystem corruption” is the result of the flaw.
The problem appears to strike RAID0 users, on Arch Linux and Debian.
Fixes are available, one explained by Lukas Czerner on the Linux Kernel Mailing List . That post suggests the bug is long-standing, possibly as far back as the 3.12-stable kernel. Others suggest the bug has only manifested in Linux 4.x.
The problem is described by Czerner as follows:
“The problem is that when we insert delayed extent into extent status tree the only way to get rid of it is when we write out delayed buffer. However there is a limitation in the extent status tree implementation so that when inserting unwritten extent should there be even a single delayed block the whole unwritten extent would be marked as delayed.
At this point, there is no way to get rid of the delayed extents, because there are no delayed buffers to write out. So when a we write into said unwritten extent we will convert it to written, but it still remains delayed.
When we try to write into that block later ext4_da_map_blocks() will set the buffer new and delayed and map it to invalid block which causes the rest of the block to be zeroed loosing already written data.”
All of which sounds just terrifying and means that this patch for version 4.x and the patched Linux kernel 3.12.43 LTS both seem like sensible code to contemplate. If you want to hang on to your data. Which you probably do. ®