Re: fsync in glib/gio



On Thu, 2009-03-12 at 17:05 -0400, Colin Walters wrote:
> 2009/3/12 Alexander Larsson <alexl redhat com>:
> > With all the recent yahoo about ext4 data loss and fsync I felt I had to
> > look at glib and make sure we're doing this right.
> >
> > Attached is a patch that makes sure we fsync before closing in the gio
> > file saving code and in g_file_set_contents().
> >
> > It also adds G_FILE_CREATE_ASYNC_WRITE flag to disable the fsync in the
> > gio saving code. This is used in the file copy code as I think the fsync
> > may significantly affect performance when copying lots of files. This is
> > similar to cp, which also doesn't fsync, so I think this is a decent
> > compromise. At least we do the safe thing when apps save a document.
> 
> Does this affect things like nautilus bulk file operations (copy+paste
> directory)?  If so, is there a patch for nautilus to use the new flag,
> or are we saying that these operations should also be sync?

Nautilus uses g_file_copy() & co, so they will be async due to it
specifying G_FILE_CREATE_ASYNC_WRITE.



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