From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 256E8C54FD0 for ; Mon, 20 Apr 2020 17:30:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EDEC8207FC for ; Mon, 20 Apr 2020 17:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587403834; bh=WJI0iLfDsytzXcwanqGsflVdhW1CScnnDHgpeUZuVRc=; h=From:To:Cc:Subject:Date:List-ID:From; b=We0VgU+hNYBk7gpi0ex8YeSFuedDaN10WOX+30Y/1QnMDAHaFi0VGGTqFufhvc7JS vWFom2pPBnHPEXRg8kIo2AquVIJyX57srsC20BWNOUvneS4zZYsNV1N8xAlO/R00nq 4ciZ0CIfSxkijyz5QuvVGo/hg8+EtgRIcsrFgMCM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbgDTRac (ORCPT ); Mon, 20 Apr 2020 13:30:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:49962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbgDTRab (ORCPT ); Mon, 20 Apr 2020 13:30:31 -0400 Received: from tleilax.com (68-20-15-154.lightspeed.rlghnc.sbcglobal.net [68.20.15.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 573C520782; Mon, 20 Apr 2020 17:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587403831; bh=WJI0iLfDsytzXcwanqGsflVdhW1CScnnDHgpeUZuVRc=; h=From:To:Cc:Subject:Date:From; b=eMzXdyGJCECydOrsTRmLVZPCtkcGTNjT3cKOddec8xU0idn1+l802im22eRVe3KkN 6TyKXjzeT3OIURok6NEh/XQqrpqG4Jj52euu5GiicrNYo78HqFOTh3lZO0vMRjM2Xi XtJfs6xiBSrMymwsRHycyZ37qTi/6N6M+9XC37UE= From: Jeff Layton To: linux-man@vger.kernel.org Cc: linux-api@vger.kernel.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, andres@anarazel.de, dhowells@redhat.com, willy@infradead.org, hch@infradead.org, jack@suse.cz, david@fromorbit.com, linux-kernel@vger.kernel.org Subject: [RFC man-pages PATCH] sync.2: add details about new syncfs() behavior Date: Mon, 20 Apr 2020 13:30:29 -0400 Message-Id: <20200420173029.31627-1-jlayton@kernel.org> X-Mailer: git-send-email 2.25.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org syncfs() now also returns errors if writeback fails. Signed-off-by: Jeff Layton --- man2/sync.2 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) This patch shouldn't be merged until the relevant kernel patch series has been merge. I'm hoping to get this into v5.8: [PATCH v6 0/2] vfs: have syncfs() return error when there are writeback errors diff --git a/man2/sync.2 b/man2/sync.2 index 7198f3311b05..a025080713ed 100644 --- a/man2/sync.2 +++ b/man2/sync.2 @@ -86,11 +86,26 @@ to indicate the error. is always successful. .PP .BR syncfs () -can fail for at least the following reason: +can fail for at least the following reasons: .TP .B EBADF .I fd is not a valid file descriptor. +.TP +.B EIO +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. +.TP +.B ENOSPC +Disk space was exhausted while synchronizing. +.TP +.BR ENOSPC ", " EDQUOT +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. .SH VERSIONS .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. +.PP +In mainline kernel versions prior to 5.8, +.\" commit <<< TBD >>> +.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. .SH BUGS Before version 1.3.20 Linux did not wait for I/O to complete before returning. -- 2.25.3