Created attachment 255041 [details]
Add a NOTE to fsync man page that errors are cleared on return
The fsync man page does not mention that when fsync returns EIO or ENOSPC, the error flag in the mapping is cleared. A subsequent call to fsync() of the same FD will succeed. It is thus not safe to retry fsync on EIO or ENOSPC and assume that 0 return means writes prior to the first fsync() call are on disk.
See http://stackoverflow.com/q/42434872/398670 for kernel source details, a demo/test program, etc.
Attached is draft wording for this.
(Following on from #194755)