Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp754453ybg; Wed, 10 Jun 2020 12:51:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbBpGTQu4CsV8JePrsNVPu3Gm2r9yu7Zf8AB99f4mzbl11NVuBl01VPv6lgvbSee2qaK4t X-Received: by 2002:a17:906:938b:: with SMTP id l11mr4760450ejx.99.1591818693283; Wed, 10 Jun 2020 12:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591818693; cv=none; d=google.com; s=arc-20160816; b=FLM0s28+o7fTSlGJBAKhKZ1sTcX2E1sjGIAh4+gmGmZoi3FnS0WxfY0Az2ZLIkARZ3 +AVtOk3/lMVVjaCGDuhEMsNMquzhUuiXo8XmSjna3P7HZy4bTcErzUpUxr/6nPAjYh6D jLCgHXunT4U8/tgsHugYc/49sXbzXi9dAyP5nKFGmPUdQVQaUEFQ3R2cjWDUPQTBML8y ahPH7gtffrIwBEGU9Mcs185FrZh9abbMqXetT8KxYVx/SYLcBb43tzZgf3WVqqxu2bOs kf+RhL29uTzk8DrFw2+BQv9g4PBkPkOPsyu14cLFSFE9xzEUMgFBtupS+pU6IjIE5IFu 6q4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ChG0WIexRszNuIQhZphA6Zizf2a7xZ8ZkKVTCncoXqc=; b=vgtvjs/YYLA0OX1vsTIMhWmhEf2QcWdkQGk5ZD0mWouusuaAEg8gAW94obd4M6Y3FN 5olF2opUGwL7IdMMej9TkO7S+Kd67sRIA10073G5ykPlZGD5mbA5QQw0ar7x7cyNJef/ sgZVkttf2/kqgjrOUUMkTL8tMDO1zo+qCQKpQYV9DetrXafmv6uV0r/etxAPTAA7cVUH QqxE8f+r2s3IITjkPRs5Tr4yNMvcUpnhihAtS0GNoMnIfD77C9e5+h4UQik/lqDFZ6mq Xpu37s9n2mTzLTMT+RSAXYI0a6BSubjYXKB0HswB3j9tczQy3qU9nIV5zgC/uJYGJS3a PrDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pxYTFTM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s4si355112edy.21.2020.06.10.12.51.05; Wed, 10 Jun 2020 12:51:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pxYTFTM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730433AbgFJPuQ (ORCPT + 99 others); Wed, 10 Jun 2020 11:50:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:47966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730336AbgFJPuP (ORCPT ); Wed, 10 Jun 2020 11:50:15 -0400 Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (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 CA0A8206C3; Wed, 10 Jun 2020 15:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591804215; bh=gjNi9v8mH0UE14YlBjV9C7FAXJQuACnUBQ+1HxXujq8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pxYTFTM6+6hKI5D1epsl48SmXcRjOBEt8sQ+0GCnrbjo8tOx0zkNan2Gb4mVS/sSU 2UdnoVKqsVgEVtc4oBDq7DD/NZDEs+OKexSEFRWEu0YRL7DzURB54rbwpLDawaDR7R qNk4xmtA4yXe/MrtTSxASUbeUpQBoDSgYht6S/u0= Date: Wed, 10 Jun 2020 08:50:13 -0700 From: Eric Biggers To: Jeff Layton Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][man-pages] sync.2: syncfs() now returns errors if writeback fails Message-ID: <20200610155013.GA1339@sol.localdomain> References: <20200610103347.14395-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200610103347.14395-1-jlayton@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 10, 2020 at 06:33:47AM -0400, Jeff Layton wrote: > 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. > .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 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. The sentence "In mainline kernel versions prior to 5.8, syncfs() will only fail with EBADF when passed a bad file descriptor" is ambiguous. It could mean that EBADF can now mean other things too. Maybe write: "In mainline kernel versions prior to 5.8, syncfs() will only fail when passed a bad file descriptor (EBADF)." - Eric