[Python-Dev] Ext4 data loss

Joachim König him at online.de
Wed Mar 11 10:09:43 CET 2009

Guido van Rossum wrote:
> On Tue, Mar 10, 2009 at 1:11 PM, Christian Heimes <lists at cheimes.de> wrote:
>> [...]
>> https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/317781/comments/54.
>> [...]
> If I understand the post properly, it's up to the app to call fsync(),
> and it's only necessary when you're doing one of the rename dances, or
> updating a file in place. Basically, as he explains, fsync() is a very
> heavyweight operation; I'm against calling it by default anywhere.
To me, the flaw seem to be in the close() call (of the operating 
system). I'd expect the data to be
in a persistent state once the close() returns. So there would be no 
need to fsync if the file gets closed anyway.

Of course the close() call could take a while (up to 30 seconds in 
laptop mode), but if one does
not want to wait that long, than one can continue without calling 
close() and take the risk.

Of course, if the data should be on a persistant storage without closing 
the file (e.g. for database
applications), than one has to carefully call the different sync 
methods, but that's an other story.

Why has this ext4 problem not come up for other filesystems?

More information about the Python-Dev mailing list