In article <[email protected]>,
Matthew Mondor <[email protected]> wrote:
>On Mon, 31 Oct 2011 19:58:27 -0400
>Greg Troxel <[email protected]> wrote:
>
>> Obligatory actual netbsd tech-kern content: It seems like we really need
>> a sync_synchronous(2) system call that guarantees that all file system
>> operations that have completed (syscall returned) before the issuance of
>> the sync_synchronous call are on disk before sync_synchronous returns.
>> It seems odd that for sync, there is no waiting, fsync seems to wait,
>> and fsync_range can flush or not flush caches, more or less.
>
>Hmm since in sync(2), the non-synchronous issue is noted as a bug:
>
>BUGS
> sync() may return before the buffers are completely flushed.
>
>Does this mean that sync(2) should normally be synchronous and fixed to
>be, such that sync_synchronous(2) not be necessary?
Which sync man page are you reading? Ours has:
Historically, sync() would schedule buffers for writing but not actually
wait for the writes to finish. It was necessary to issue a second or
sometimes a third call to ensure that all buffers had in fact been writ-
ten out. In NetBSD, sync() does not return until all buffers have been
written.
christos