All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Andreas Dilger <adilger@dilger.ca>, Jeff Layton <jlayton@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	linux-mm <linux-mm@kvack.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	lsf-pc <lsf-pc@lists.linuxfoundation.org>,
	Neil Brown <neilb@suse.de>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	linux-block@vger.kernel.org
Subject: Re: [LSF/MM TOPIC] do we really need PG_error at all?
Date: Tue, 28 Feb 2017 10:32:34 +1100	[thread overview]
Message-ID: <87varvp5v1.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <DC27F5BA-BCCA-41FF-8D41-7BB99AA4DB26@dilger.ca>

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

On Mon, Feb 27 2017, Andreas Dilger wrote:

>
> My thought is that PG_error is definitely useful for applications to get
> correct errors back when doing write()/sync_file_range() so that they know
> there is an error in the data that _they_ wrote, rather than receiving an
> error for data that may have been written by another thread, and in turn
> clearing the error from another thread so it *doesn't* know it had a write
> error.

It might be useful in that way, but it is not currently used that way.
Such usage would be a change in visible behaviour.

sync_file_range() calls filemap_fdatawait_range(), which calls
filemap_check_errors().
If there have been any errors in the file recently, inside or outside
the range, the latter will return an error which will propagate up.

>
> As for stray sync() clearing PG_error from underneath an application, that
> shouldn't happen since filemap_fdatawait_keep_errors() doesn't clear errors
> and is used by device flushing code (fdatawait_one_bdev(), wait_sb_inodes()).

filemap_fdatawait_keep_errors() calls __filemap_fdatawait_range() which
clears PG_error on every page.
What it doesn't do is call filemap_check_errors(), and so doesn't clear
AS_ENOSPC or AS_EIO.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2017-02-27 23:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-26 14:42 [LSF/MM TOPIC] do we really need PG_error at all? Jeff Layton
2017-02-26 14:42 ` Jeff Layton
2017-02-26 14:42 ` Jeff Layton
2017-02-26 17:10 ` James Bottomley
2017-02-26 17:10   ` James Bottomley
2017-02-26 21:03   ` NeilBrown
2017-02-26 22:43     ` Jeff Layton
2017-02-26 22:43       ` Jeff Layton
2017-02-26 23:30     ` James Bottomley
2017-02-26 23:57       ` Jeff Layton
2017-02-26 23:57         ` Jeff Layton
2017-02-27  0:27       ` NeilBrown
2017-02-27 15:07         ` Jeff Layton
2017-02-27 15:07           ` Jeff Layton
2017-02-27 22:51           ` Andreas Dilger
2017-02-27 23:02             ` Jeff Layton
2017-02-27 23:02               ` Jeff Layton
2017-02-27 23:32             ` NeilBrown [this message]
2017-02-28  1:11               ` [Lsf-pc] " Jeff Layton
2017-02-28  1:11                 ` Jeff Layton
2017-02-28  1:11                 ` Jeff Layton
2017-02-28 10:12                 ` Boaz Harrosh
2017-02-28 10:12                   ` Boaz Harrosh
2017-02-28 11:32                   ` Jeff Layton
2017-02-28 11:32                     ` Jeff Layton
2017-02-28 20:45                 ` NeilBrown

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=87varvp5v1.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=adilger@dilger.ca \
    --cc=jlayton@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lsf-pc@lists.linuxfoundation.org \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.