1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems


Facebook RSS Twitter Twitter Google Plus


Phoronix Test Suite

OpenBenchmarking.org

EXT4 Data Corruption Bug Hits Stable Linux Kernels

Linux Kernel

Published on 24 October 2012 06:06 AM EDT
Written by Michael Larabel in Linux Kernel
68 Comments

As a warning for those who are normally quick to upgrade to the latest stable vanilla kernel releases, a serious EXT4 data corruption bug worked its way into the stable Linux 3.4, 3.5, and 3.6 kernel series.

Being discussed recently on the Linux kernel mailing list was an "apparent serious progressive ext4 data corruption bug in 3.6.3." Theodore Ts'o was able to successfully bisect the kernel and found the serious bug, which first appeared within the Linux 3.6.2 kernel and was since back-ported to older stable kernels.

From the user reporting this problem, "The bug did really quite a lot of damage to my /home fs in only a few minutes of uptime, given how few files I wrote to it. What it could have done to a more conventional distro install with everything including /home on one filesystem, I shudder to think."

Ted Ts'o wrote in the thread:
I think I've found the problem. I believe the commit at fault is commit 14b4ed22a6 (upstream commit eeecef0af5e):

jbd2: don't write superblock when if its empty

which first appeared in v3.6.2.

The reason why the problem happens rarely is that the effect of the buggy commit is that if the journal's starting block is zero, we fail to truncate the journal when we unmount the file system. This can happen if we mount and then unmount the file system fairly quickly, before the log has a chance to wrap. After the first time this has happened, it's not a disaster, since when we replay the journal, we'll just replay some extra transactions. But if this happens twice, the oldest valid transaction will still not have gotten updated, but some of the newer transactions from the last mount session will have gotten written by the very latest transacitons, and when we then try to do the extra transaction replays, the metadata blocks can end up getting very scrambled indeed.

*Sigh*. My apologies for not catching this when I reviewed this patch. I believe the following patch should fix the bug; once it's reviewed by other ext4 developers, I'll push this to Linus ASAP.

- Ted
Here's a response with some more comments from one of the affected users for this EXT4 data corruption bug in the stable kernel.

To Ted's patch, Red Hat's Eric Sandeen reviewing the work raised some questions as to whether it fully fixed the problem and Ted has already tossed out a new patch.

EXT4 Data Corruption Bug Hits Stable Linux Kernels
The Linux bug hunting is still on-going...

As far as how you get hit by this EXT4 bug, Ted says, "Well, the problem won't show up if the journal has wrapped. So it will only show up if the system has been rebooted twice in fairly quick succession. A full conventional distro install probably wouldn't have triggered a bug... although someone who habitually reboots their laptop instead of using suspend/resume or hiberbate, or someone who is trying to bisect the kernel looking for some other bug could easily trip over this --- which I guess is how you got hit by it."

The problematic commit causing this potential EXT4 data issue was back-ported previous to the stable Linux 3.4.x and 3.5.x kernels, which are reaching end-of-life. Hopefully an exception will be made and new kernels issued soon.

That's where things are at right now in the mailing list thread for this serious EXT4 data corruption issue that reached the stable Linux kernel.

About The Author
Michael Larabel is the principal author of Phoronix.com and founded the web-site in 2004 with a focus on enriching the Linux hardware experience and being the largest web-site devoted to Linux hardware reviews, particularly for products relevant to Linux gamers and enthusiasts but also commonly reviewing servers/workstations and embedded Linux devices. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics hardware drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated testing software. He can be followed via and or contacted via .
Latest Linux Hardware Reviews
  1. Gigabyte AM1M-S2H
  2. AMD's New Athlon/Semprons Give Old Phenom CPUs A Big Run For The Money
  3. 13-Way Low-End GPU Comparison With AMD's AM1 Athlon
  4. ASUS AM1I-A: A Mini-ITX Board For Socketed Kabini APUs
Latest Linux Articles
  1. How Much Video RAM Is Needed For Catalyst R3 Graphics?
  2. Ubuntu 12.04 LTS vs. 14.04 LTS Cloud Benchmarks
  3. Ubuntu 12.04.4 vs. 13.10 vs. 14.04 LTS Desktop Benchmarks
  4. AMD OpenCL Performance With AM1 Kabini APUs
Latest Linux News
  1. Cross-Desktop Collaboration During FreeDesktop Summit 2014
  2. EmScripten Merges Its Speedy "Fastcomp" Backend
  3. Nuclear Dawn Update Has Full Linux Support
  4. Oracle Linux 6.5 vs. Oracle Linux 7.0 Beta Benchmarks
  5. Easter Yields The Linux 3.15-rc2 Kernel Release
  6. The Most Amazing OpenGL Tech Demo In 64kb
  7. Packard Bell LM85 Now Supported By Coreboot
  8. AmazonBasics External USB 2.0 DVD Writer For Linux
  9. TP-LINK TG-3468: A $12 Linux PCI-E Gigabit Network Adapter
  10. Linux 3.15 Lands Some DRM Graphics Driver Fixes
  11. AMD Is Disabling DPM Support For RV770 GPUs
  12. ReactOS Working On A Community Windows OS
Latest Forum Discussions
  1. ReactOS Working On A Community Windows OS
  2. The GNOME Foundation Is Running Short On Money
  3. Updated and Optimized Ubuntu Free Graphics Drivers
  4. Catalyst 14.3 Beta
  5. Suggestions about how to make a Radeon HD 7790 work decently?
  6. Radeon 8000M problematic on Linux?
  7. Linux Kernel Developers Fed Up With Ridiculous Bugs In Systemd
  8. After Jack Keane, RuseSoft will briing Ankh 3 to Linux through Desura