Re: Linux-only fdatasync() in 3c13bc

Subject: Re: Linux-only fdatasync() in 3c13bc

Date: Wed, 7 May 2014 13:18:36 -0400

To: David Bremner

Cc: Tomi Ollila, notmuch@notmuchmail.org

From: Austin Clements


Quoth David Bremner on May 07 at 10:17 pm:
> Tomi Ollila <tomi.ollila@iki.fi> writes:
> 
> > On Wed, May 07 2014, Kushal Kumaran <kushal.kumaran+notmuch@gmail.com> wrote:
> >
> >> Xīcò <xico@atelo.org> writes:
> >>
> >>> Also, commit 3c13bc introduced a call to fdatasync() which is not
> >>> available on FreeBSD, and probably not either on MacOS at least.
> >>>
> >>
> >> fdatasync is POSIX:
> >> http://pubs.opengroup.org/onlinepubs/009695399/functions/fdatasync.html
> >
> > No wonder it is problematic, then >;)
> >
> 
> I seem to recall Austin saying on IRC that this usage was guaranteed to
> call fsync anyway. Comments Austin?

Yes, since the size of the file will have definitely changed, the
metadata will have to be flushed anyway, so using fdatasync here has
no advantage over using fsync.

Thread: