← Back to team overview

ecryptfs team mailing list archive

[Bug 317781] Re: Ext4 data loss

 

Theo, I have tremendous respect for the work you did, but you are wrong.

> If you are going to be using a single monolithic config, then you really want to
> fsync() it each time you write it out.   If some of the changes are
> bullsh*t ones where it really doesn't matter of you lose the last
> location and size of the window, then write that to a separate dot file
> and don't bother to fsync() it.

No. If I overwrite a file the filesystem MUST guarantee that either the
old version will be there or the new one. That is one of the main
selling points of a journaling file system - if the write did not
complete (crash) you can go back to the old version.

There should be NO case where you end up with a zero byte file. Telling
people to call fsync constantly is wrong. The filesystem should make
sure not to truncate the file until it's ready to write the replacement.
(Yes there are corner cases where it commits exactly in between the
truncate and the write, but that is not what is happening here.) Even a
crash in between the truncate and the overwrite should not loose
anything, since the journal should be rolled back to the old version of
the file.

Telling people to use sqllite is also not the right answer - you are
essentially saying the fs is broken so use this app to fix the bugs. I
might as well use sqlite on a raw partition!

> I can implement a "allocate on commit" mode, but make no mistake
> --- it ***will*** have a negative performance impact, because
> fundamentally it's the equivalent of calling fsync() on dirty files
> every five seconds.

No Theo, that is not what people are asking for. People simply want the
filesytem not to commit the truncate before committing the data.

I have no idea if that is hard to do, I assume it is because you seem to
be resisting the idea, but it needs to be done for ext4 to be a reliable
filesystem.

-- 
Ext4 data loss
https://bugs.launchpad.net/bugs/317781
You received this bug notification because you are a member of eCryptfs,
which is subscribed to ecryptfs-utils in ubuntu.

Status in “ecryptfs-utils” source package in Ubuntu: Invalid
Status in “linux” source package in Ubuntu: Confirmed
Status in ecryptfs-utils in Ubuntu Jaunty: Invalid
Status in linux in Ubuntu Jaunty: Confirmed

Bug description:
I recently installed Kubuntu Jaunty on a new drive, using Ext4 for all my data.

The first time i had this problem was a few days ago when after a power loss ktimetracker's config file was replaced by a 0 byte version . No idea if anything else was affected.. I just noticed ktimetracker right away.

Today, I was experimenting with some BIOS settings that made the system crash right after loading the desktop. After a clean reboot pretty much any file written to by any application (during the previous boot) was 0 bytes.
For example Plasma and some of the KDE core config files were reset. Also some of my MySQL databases were killed...

My EXT4 partitions all use the default settings with no performance tweaks. Barriers on, extents on, ordered data mode..

I used Ext3 for 2 years and I never had any problems after power losses or system crashes.

Jaunty has all the recent updates except for the kernel that i don't upgrade because of bug #315006

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: linux-image-2.6.28-4-generic 2.6.28-4.6
ProcCmdLine: root=UUID=81942248-db70-46ef-97df-836006aad399 ro rootfstype=ext4 vga=791 all_generic_ide elevator=anticipatory
ProcEnviron:
 LANGUAGE=
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.28-4.6-generic
SourcePackage: linux