Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 262507 - ext4: potential data loss on unclean shutdown
Summary: ext4: potential data loss on unclean shutdown
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL: https://bugs.launchpad.net/ubuntu/+so...
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2009-03-15 04:16 UTC by Gordon Malm (RETIRED)
Modified: 2009-03-24 04:28 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gordon Malm (RETIRED) gentoo-dev 2009-03-15 04:16:59 UTC
There is potential for data loss on ext4 in the case of an unclean shutdown.  The following links describe the issue in detail:

http://lwn.net/Articles/323169/
http://thunk.org/tytso/blog/2009/03/12/delayed-allocation-and-the-zero-length-file-problem/
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/317781?comments=all

Patches to fix the most common occurances are here:
http://git.kernel.org/?p=linux/kernel/git/tytso/ext4.git;a=commitdiff;h=dbc85aa9f11d8c13c15527d43a3def8d7beffdc8
http://git.kernel.org/?p=linux/kernel/git/tytso/ext4.git;a=commitdiff;h=6645f8c3bc3cdaa7de4aaa3d34d40c2e8e5f09ae
http://git.kernel.org/?p=linux/kernel/git/tytso/ext4.git;a=commitdiff;h=3bf3342f394d72ed2ec7e77b5b39e1b50fad8284

This patches inhibit the behavior of delayed allocation under certain circumstances.  They are queued only for kernel 2.6.30, not the -stable trees.  I suspect this is due to the policy that patches must be in Linus' kernel tree before they will be considered for -stable  and thus they will likely eventually be in a future 2.6.28 and/or 2.6.29 -stable release.  But for now they are not being considered.  The patches have already been accepted into the next Ubuntu Jaunty kernel:
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-jaunty.git;a=summary

I will be adding the patches in sys-kernel/hardened-sources-2.6.28-r3 (either via genpatches or hardened-extras patchset, depending on release timing).

Also of interest is:
http://git.kernel.org/?p=linux/kernel/git/tytso/ext4.git;a=commitdiff;h=17db0c1ec3d2fdd1ada0f042098f9b1dc6193982

This patch adds a mount option to revert the behavior change of the three patches above.  Perhaps of interest to non-desktop-oriented machines that are less likely to run offending software.  I doubt I will include this patch in hardened-extras, but if added to genpatches I wouldn't UNIPATCH_EXCLUDE it either.
Comment 1 Gordon Malm (RETIRED) gentoo-dev 2009-03-15 04:27:21 UTC
Unrelated, but while looking through Theodore Tso's ext4 queue I stumbled upon this patch, which I will likely also include while I'm at it:

http://git.kernel.org/?p=linux/kernel/git/tytso/ext4.git;a=commitdiff;h=3cb5e61547e9ee5f040d7a02c48c7cdf6485eecc
Comment 2 kfm 2009-03-17 23:52:06 UTC
These were folded into hardened-patches-2.6.28-4 which is based upon 2.6.28.7:

1910_ext4-automatically-allocate-delay-allocated-blocks-on-rename.patch
1911_ext4-automatically-allocate-delay-allocated-blocks-on-close.patch
1912_ext4-add-EXT4_IOC_ALLOC_DA_BLKS-ioctl.patch
1913_ext4-fix-discard-of-inode-prealloc-space-with-delayed-allocation.patch

I'm really posting to point out that the above mentioned patches are still applicable with respect to the latest 2.6.28.8 release.
Comment 3 Mike Pagano gentoo-dev 2009-03-19 14:41:04 UTC
Thanks for your work, guys. This will be in gentoo-sources-2.6.28-r4.
Comment 4 Mike Pagano gentoo-dev 2009-03-19 17:54:12 UTC
Released in gentoo-sources-2.6.28-r4