Re: fsync in glib/gio



On Tue 2009-03-24 10:30:52, Alexander Larsson wrote:
> 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.

Well, given enough pressure, I'm sure XFS can be fixed too. (And then
it can perhaps gain its "reliable filesystem" badge).

> > > 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.

One proposal was to create "replace()" call (doing proper replacement
of one file with another). It could start up as "fsync(); rename()"
initially, but it should slowly move up into glibc and kernel, and do
the right thing.
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


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