Re: fsync in glib/gio



On Fri, 2009-03-13 at 20:57 +0100, Alexander Larsson wrote:
> On Fri, 2009-03-13 at 18:45 +0100, Alexander Larsson wrote:
> > 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
> > both the old and the new version of the file, you only lose "new" files.
> > This case is far less common so the performance aspects are not as bad,
> > and its also get rids of the worst failure mode.
> 
> Attached is a patch that does this. It adds a
> G_FILE_CREATE_SYNC_ON_CLOSE flag, and turns it on by default when
> handling an overwrite. The same thing happens in g_file_set_contents().
> 
> I think we need to do this, at the minimum, because even if there are
> some ext4 patches to fix up this issue they can be disabled, and from
> what I understand XFS and btrfs have similar issues.
> 
> The question is, do we want this or the full patch?

I commited something like this limited patch to svn. However, I didn't
add the public API parts yet.




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