當 EXT4 遇上 Kernel 3.4.14、3.4.15、3.5.7、3.6.2和3.6.3 可能會讓資料不見
穩定版內核並不意味著沒有bug，最近發現的ext4文件系統數據損失bug就影響著多個穩定版內核。ext4用戶應避免使用Linux 3.4.14、3.4.15、3.5.7、3.6.2和3.6.3。內核開發者Ted Ts’o在郵件列表上指出，ext4的新補丁引入了一個導致數據發生丟失的bug，bug會在頻繁重啟或者是頻繁重裝載或卸載操作之後激發。ext4開發者正在忙碌的修復該bug。
Stable kernel updates are supposed to be just that — stable. But they are not immune to bugs, as a recent ext4 filesystem problem has shown. In short: ext4 users would be well advised to avoid versions 3.4.14, 3.4.15, 3.5.7, 3.6.2, and 3.6.3; they all contain a patch which can, in some situations, cause filesystem corruption.The problem, as explained in this note from Ted Ts’o, has to do with how the ext4 journal is managed. In some situations, unmounting the filesystem fails to truncate the journal, leaving stale (but seemingly valid) data there. After a single unmount/remount (or reboot) cycle little harm is done; some old transactions just get replayed unnecessarily. If the filesystem is quickly unmounted again, though, the journal can be left in a corrupted state; that corruption will be helpfully replayed onto the filesystem at the next mount.Fixes are in the works. The ext4 developers are taking some time, though, to be sure that the problem has been fully understood and completely fixed; there are signs that the bug may have roots far older than the patch that actually caused it to bite people. Once that process is complete, there should be a new round of stable updates (possibly even for 3.5, which is otherwise at end-of-life) and the world will be safe for ext4 users again.
(Thanks are due to LWN reader “nix” who alerted readers in the comments and reported the bug to the ext4 developers).
Update: Ted now thinks that his initial diagnosis was incomplete at best; the problem is not as well understood as it seemed. Stay tuned.
怎麼辨識是不是 EXT4 (從Filesystem features中有extent的基本上就是EXT4囉)
dumpe2fs -h /dev/sda1
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file
CentOS 目前 6.x ~ 6.3 預設都是裝EXT4，不過 Kernel 是 2.6.X