Linux-man Archive on
 help / color / Atom feed
* [PATCH][man-pages] sync.2: syncfs() now returns errors if writeback fails
@ 2020-06-10 10:33 Jeff Layton
  2020-06-10 15:50 ` Eric Biggers
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Layton @ 2020-06-10 10:33 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man, linux-fsdevel, linux-kernel

A patch has been merged for v5.8 that changes how syncfs() reports
errors. Change the sync() manpage accordingly.

Signed-off-by: Jeff Layton <>
 man2/sync.2 | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/man2/sync.2 b/man2/sync.2
index 7198f3311b05..27e04cff5845 100644
--- a/man2/sync.2
+++ b/man2/sync.2
@@ -86,11 +86,26 @@ to indicate the error.
 is always successful.
 .BR syncfs ()
-can fail for at least the following reason:
+can fail for at least the following reasons:
 .I fd
 is not a valid file descriptor.
+An error occurred during synchronization.
+This error may relate to data written to any file on the filesystem, or on
+metadata related to the filesytem itself.
+Disk space was exhausted while synchronizing.
+Data was written to a files on NFS or another filesystem which does not
+allocate space at the time of a
+.BR write (2)
+system call, and some previous write failed due to insufficient
+storage space.
 .BR syncfs ()
 first appeared in Linux 2.6.39;
@@ -121,6 +136,13 @@ or
 .BR syncfs ()
 provide the same guarantees as fsync called on every file in
 the system or filesystem respectively.
+In mainline kernel versions prior to 5.8,
+.\" commit 735e4ae5ba28c886d249ad04d3c8cc097dad6336
+.BR syncfs ()
+will only fail with EBADF when passed a bad file descriptor. In 5.8
+and later kernels, it will also report an error if one or more inodes failed
+to be written back since the last syncfs call.
 Before version 1.3.20 Linux did not wait for I/O to complete
 before returning.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 10:33 [PATCH][man-pages] sync.2: syncfs() now returns errors if writeback fails Jeff Layton
2020-06-10 15:50 ` Eric Biggers
2020-06-10 21:19   ` Jeff Layton
2020-06-25  9:45     ` Michael Kerrisk (man-pages)
2020-06-25 23:37       ` Jeff Layton

Linux-man Archive on

Archives are clonable:
	git clone --mirror linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ \
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone