Re: fsync in glib/gio



On Tue, 2009-03-24 at 10:01 +0100, Pavel Machek wrote:
 
> > > It seems wrong to work around broken file-systems on the application
> > > level. That only takes away pressure from the file-system developers to
> > > address the problem properly.
> > 
> > I don't disagree, but on the other hand. Users are losing data as we
> > speak. (See above ubuntu bug report)
> 
> It got fixed in ext4...

Yes, but not in e.g. XFS.

> > One compromise we could make it to only fsync in the case we're actually
> > overwriting an existing file. This would mean that we don't risk
> > loosing
> 
> You should fsync just before doing rename, preferably in some special
> way so that we can tell it apart from 'normal' fsync.

This is what I mean of course. And there is no such "special way"
infortunately.

> If you are overwriting files with truncate.... that is broken and
> always was. You need to use rename. 

Of course.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]