Re: fsync in glib/gio

On Fri, Mar 13, 2009 at 12:37 PM, Steve Frécinaux <nudrema gmail com> wrote:
> Alexander Larsson wrote:
>> Attached is a patch that makes sure we fsync before closing in the gio
>> file saving code and in g_file_set_contents().
> Wouldn't fdatasync be sufficient in most case ?

Narrowed reply: not all OS'es have fdatasync().  Therefore, you will
need at least fallback to fsync().

General reply:  People, are you sure that "trashing" of all OS'es with
all filesystems by general-purpose library is a good way to workaround
_application_ problem on the one concrete OS plus one concrete FS

IMHO, it is indded application level problem.  On databases -- yes, we
need to save any and every data at any cost.  But it is extreme case
and people who writting DB servers do syncs anyway independly on OS
and FS, just because of nature of application.

But when "paranoia-mode" begins drive anything anywere on the
desktop...  Unsure that it is good.  If follow it, then all partitions
should me remounted with "-o sync" mode and all other modes should be
declared obsolete and removed.  Unsure that it is good (again)...

Andrew W. Nosenko <andrew w nosenko gmail com>

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