linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
	milan.opensource@gmail.com, lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Jeff Layton <jlayton@kernel.org>
Subject: Re: [PATCH] fsync.2: ERRORS: add EIO and ENOSPC
Date: Wed, 9 Sep 2020 13:21:10 +0200	[thread overview]
Message-ID: <20200909112110.GA29150@quack2.suse.cz> (raw)
In-Reply-To: <7be61144-0e77-3c31-d720-f2cbe56bc81e@gmail.com>

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 <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2020-09-09 11:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-29  7:13 [PATCH] fsync.2: ERRORS: add EIO and ENOSPC milan.opensource
2020-09-07  7:11 ` Michael Kerrisk (man-pages)
2020-09-08 11:27   ` Jan Kara
2020-09-08 16:10     ` Jeff Layton
2020-09-09 22:50       ` NeilBrown
2020-09-08 19:44     ` Jeff Layton
2020-09-09 10:53       ` Michael Kerrisk (man-pages)
2020-09-09 23:04       ` NeilBrown
2020-09-10 17:42         ` Jeff Layton
2020-09-16 23:25           ` NeilBrown
2020-09-17  7:01             ` Michael Kerrisk (man-pages)
2020-09-09 10:52     ` Michael Kerrisk (man-pages)
2020-09-09 11:21       ` Jan Kara [this message]
2020-09-09 11:58         ` Michael Kerrisk (man-pages)
2020-09-09 14:14           ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200909112110.GA29150@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=milan.opensource@gmail.com \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).