Bug 194757

Summary: fsync man page should mention that EIO and ENOSPC are cleared
Product: Documentation Reporter: Craig Ringer (craig.ringer)
Component: man-pagesAssignee: documentation_man-pages (documentation_man-pages)
Status: NEW ---    
Severity: normal CC: milan.opensource, tnelis
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:
Attachments: Add a NOTE to fsync man page that errors are cleared on return

Description Craig Ringer 2017-03-02 03:21:05 UTC
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)
Comment 1 Milan Shah 2020-08-30 05:43:29 UTC
Sent patch
to:	mtk.manpages@gmail.com
cc:	linux-kernel@vger.kernel.org