Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp255567pxk; Wed, 9 Sep 2020 04:43:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxON5ChWzbYcevYFKqKqPcHLkxRw3uRL8IZ3+6lvB0R+KXKUvQ4bdm/7SFO+xgX4BkCspjq X-Received: by 2002:a17:906:33ca:: with SMTP id w10mr3379450eja.438.1599651784856; Wed, 09 Sep 2020 04:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599651784; cv=none; d=google.com; s=arc-20160816; b=ZxpiLgLwSLQP5c3+S5elZAbP5lGjyXlmBAnwyGse0ESDGGAYpchAwIgMUetoCf0QoK PHzovOm3SdXQrTz3CrLf8+4bJGDLLbZvMLDsy+NNWu52CwNtqqC3YxwCuimStXKUnaPi gjS9LW1wqDcltqgbxqdPkKhOFw3xKm2I5hWdJpMHcwAWFpLo2g61mLhYbp+gb97mjI6v BU7HjEmov3jQjIDtHHS1oEgOrxwl9S0dHHrYhM0K3dLiYn0JY6VxH0Gut/Ke1QQpK1Vs atj2czi77pmIzxqczAnHBVO4/TScLW52hGowMYB9TgQnNazVdy2Ro+dGfvL5hZ4rTe9A XLAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fykF52vLuwL3PrI6Nfw3+W2+loxSy5U3zCe6YNGmFw0=; b=D4+m1GZPaDMS7DPSnStfWk2XwbssFPBoNKoFNzRS3O2c30wTZFgAlO2MuPz8Ojm/AK j/4lB2c6Sv+tJvbErK3/euFotipFf/xGziA8uLzMXF0JaDCat6dp6/mpTilCQ1mYvhFa GvRCvD4iXNhy1BGxXL1zgfOMAPG1mrMxCIUMEySOL8mNuWd4FlAyakeNenI5WB2epyS7 ABg4/6yEQ3I7k3xM7fDmn1XEbOwcfgUxaXv9aYVxjOjLMzS7K+9K/6erJppjvZFRzY3I +AXvLDqi9EThCY4jQGEjjTSQVYWcWTWfLo49uU1BfHzmIlZMgU0oC0dlIzrEqakJwyWQ gIAg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q5si1237510eji.118.2020.09.09.04.42.41; Wed, 09 Sep 2020 04:43:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729305AbgIILkS (ORCPT + 99 others); Wed, 9 Sep 2020 07:40:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:33016 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbgIILdr (ORCPT ); Wed, 9 Sep 2020 07:33:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B6A26AEE9; Wed, 9 Sep 2020 11:21:11 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id AD94B1E12E5; Wed, 9 Sep 2020 13:21:10 +0200 (CEST) Date: Wed, 9 Sep 2020 13:21:10 +0200 From: Jan Kara To: "Michael Kerrisk (man-pages)" Cc: Jan Kara , milan.opensource@gmail.com, lkml , Andrew Morton , "linux-fsdevel@vger.kernel.org" , Jeff Layton Subject: Re: [PATCH] fsync.2: ERRORS: add EIO and ENOSPC Message-ID: <20200909112110.GA29150@quack2.suse.cz> References: <1598685186-27499-1-git-send-email-milan.opensource@gmail.com> <20200908112742.GA2956@quack2.suse.cz> <7be61144-0e77-3c31-d720-f2cbe56bc81e@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7be61144-0e77-3c31-d720-f2cbe56bc81e@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 09-09-20 12:52:48, Michael Kerrisk (man-pages) wrote: > > So the error state isn't really stored "on pages in the file mapping". > > Current implementation (since 4.14) is that error state is stored in struct > > file (I think this tends to be called "file description" in manpages) and > > (Yes, "open file description" is the POSIX terminology for the thing that > sits between the FD and the inode--struct file in kernel parlance--and I > try to follow POSIX terminology in the manual pages where possible. > > > so EIO / ENOSPC is reported once for each file description of the file that > > was open before the error happened. Not sure if we want to be so precise in > > the manpages or if it just confuses people. > > Well, people are confused now, so I think more detail would be good. > > > Anyway your takeway that no > > error on subsequent fsync() does not mean data was written is correct. > > Thanks. (See also my rply to Jeff.) > > By the way, a question related to your comments above. In the > errors section, there is this: > > EIO An error occurred during synchronization. This error may > relate to data written to some other file descriptor on the > * same file. Since Linux 4.13, errors from write-back will > be reported to all file descriptors that might have written > the data which triggered the error. Some filesystems > (e.g., NFS) keep close track of which data came through > which file descriptor, and give more precise reporting. > Other filesystems (e.g., most local filesystems) will > report errors to all file descriptors that were open on the > * file when the error was recorded. > > In the marked (*) lines, we have the word "file". Is this accurate? I mean, I > would normally take "file" in this context to mean the inode ('struct inode'). > But I wonder if really what is meant here is "open file description" > ('struct file'). In other words, is the EIO being generated for all FDs > connected to the same open file description, or for all FDs for all of the > open file descriptions connected to the inode? Your thoughts? The error gets reported once for each "open file description" of the file (inode) where the error happened. If there are multiple file descriptors pointing to the same open file description, then only one of those file descriptors will see the error. This is inevitable consequence of kernel storing the error state in struct file and clearing it once it is reported... Honza -- Jan Kara SUSE Labs, CR