All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Jeff Layton <jlayton@redhat.com>, linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	tytso@mit.edu, jack@suse.cz, willy@infradead.org,
	viro@zeniv.linux.org.uk
Subject: Re: [PATCH v2 08/17] fs: retrofit old error reporting API onto new infrastructure
Date: Mon, 24 Apr 2017 08:38:54 +1000	[thread overview]
Message-ID: <87pog2rbpd.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <1492778818.7308.8.camel@redhat.com>

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

On Fri, Apr 21 2017, Jeff Layton wrote:

> On Tue, 2017-04-18 at 08:56 +1000, NeilBrown wrote:
>> On Wed, Apr 12 2017, Jeff Layton wrote:
>> 
>> > On Thu, 2017-04-13 at 08:14 +1000, NeilBrown wrote:
>> > > 
>> > > I suspect that the filemap_check_wb_error() will need to be moved
>> > > into some parent of the current call site, which is essentially what you
>> > > suggest below.  It would be nice if we could do that first, rather than
>> > > having the current rather odd code.  But maybe this way is an easier
>> > > transition.  It isn't obviously wrong, it just isn't obviously right
>> > > either.
>> > > 
>> > 
>> > Yeah. It's just such a daunting task to have to change so much of the
>> > existing code. I'm looking for ways to make this simpler.
>> > 
>> > I think it probably is reasonable for filemap_write_and_wait* to just
>> > sample it as early as possible in those functions. filemap_fdatawait is
>> > the real questionable one, as you may have already had some writebacks
>> > complete with errors.
>> > 
>> > In any case, my thinking was that the old code is not obviously correct
>> > either, so while this shortens the "error capture window" on these
>> > calls, it seems like a reasonable place to start improving things.
>> 
>> I agree.  It wouldn't hurt to add a note to this effect in the patch
>> comment so that people understand that the code isn't seen to be
>> "correct" but only "no worse" with clear direction on what sort of
>> improvement might be appropriate.
>> 
>
> I've got a cleaned-up set that is getting close to ready for
> reposting. Before I do though, I think there is another option here
> that's worth discussing.
>
> We could store a second wb_err_t (aka errseq_t in the new set) in the
> mapping that would would basically act as a "cursor" for these cases.
> filemap_check_errors would need to do something like 
> filemap_report_wb_error, but it would swap the value into the mapping's
> cursor instead of dealing with the one in struct file.
>
> I don't really like adding yet another field here, but the struct
> address_space definition has this:
>
>     __attribute__((aligned(sizeof(long))));
>
> Adding the wb_err field means that we end up growing the struct by 8
> bytes on x86_64 anyway. Adding another 4 bytes would just consume the
> pad, so it wouldn't cost anything there. YMMV on other arches of
> course.
>
> That's also not perfectly like what we have with AS_EIO/AS_ENOSPC
> flags, but is probably close enough not to matter.
>
> So...this would let us limp along for even longer with the model of
> reporting since last check. I'm not sure that's a good thing though. A
> long term goal here is to have kernel code that's dealing with
> writeback be more deliberate about the point from which it's checking
> errors, and this doesn't help promote that.

I think this question needs some input from filesystem developers who
might be affected by the answer.

My preference is to not add this field.  I think we would eventually
want to remove it again, and it is easier to ensure it doesn't stay
forever if it is never added.
The version without this field isn't (I think) too bad, but maybe it is
bad enough to motivate fs developers to create a better solution in each
individual case.

If some filesystem developer says they don't like that sort of social
engineering, or objects for any other reason, I will bow to the superior
stake they hold.

NeilBrown

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

  reply	other threads:[~2017-04-23 22:39 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12 12:05 [PATCH v2 00/17] fs: introduce new writeback error reporting and convert existing API as a wrapper around it Jeff Layton
2017-04-12 12:05 ` [PATCH v2 01/17] mm: drop "wait" parameter from write_one_page Jeff Layton
2017-04-12 12:15   ` Jan Kara
2017-04-12 14:27   ` Matthew Wilcox
2017-04-12 14:34     ` Jeff Layton
2017-04-12 15:12     ` Dave Kleikamp
2017-04-12 12:05 ` [PATCH v2 02/17] mm: fix mapping_set_error call in me_pagecache_dirty Jeff Layton
2017-04-12 12:16   ` Jan Kara
2017-04-12 14:28   ` Matthew Wilcox
2017-04-12 12:06 ` [PATCH v2 03/17] buffer: use mapping_set_error instead of setting the flag Jeff Layton
2017-04-12 12:17   ` Jan Kara
2017-04-12 14:29   ` Matthew Wilcox
2017-04-12 12:06 ` [PATCH v2 04/17] ext2: don't test/clear AS_EIO flag Jeff Layton
2017-04-12 12:29   ` Jan Kara
2017-04-12 12:30     ` Jeff Layton
2017-04-12 12:06 ` [PATCH v2 05/17] orangefs: don't call filemap_write_and_wait from fsync Jeff Layton
2017-04-12 12:06 ` [PATCH v2 06/17] mm: doc comment for scary spot in write_one_page Jeff Layton
2017-04-12 13:01   ` Jeff Layton
2017-04-12 14:38     ` Matthew Wilcox
2017-04-12 15:52       ` Jeff Layton
2017-04-12 21:36         ` NeilBrown
2017-04-12 22:55           ` Jeff Layton
2017-04-12 12:06 ` [PATCH v2 07/17] fs: new infrastructure for writeback error handling and reporting Jeff Layton
2017-04-12 18:42   ` Jeff Layton
2017-04-12 21:55     ` NeilBrown
2017-04-12 23:01       ` Jeff Layton
2017-04-17 22:53         ` NeilBrown
2017-04-12 12:06 ` [PATCH v2 08/17] fs: retrofit old error reporting API onto new infrastructure Jeff Layton
2017-04-12 22:14   ` NeilBrown
2017-04-12 22:41     ` Jeff Layton
2017-04-17 22:56       ` NeilBrown
2017-04-21 12:46         ` Jeff Layton
2017-04-23 22:38           ` NeilBrown [this message]
2017-04-24 11:50             ` Jeff Layton
2017-04-17 15:17     ` Jeff Layton
2017-04-12 12:06 ` [PATCH v2 09/17] mm: remove AS_EIO and AS_ENOSPC flags Jeff Layton
2017-04-12 12:06 ` [PATCH v2 10/17] dax: set errors in mapping when writeback fails Jeff Layton
2017-04-12 12:06 ` [PATCH v2 11/17] nilfs2: set the mapping error when calling SetPageError on writeback Jeff Layton
2017-04-12 12:06 ` [PATCH v2 12/17] mm: ensure that we set mapping error if writeout() fails Jeff Layton
2017-04-12 12:06 ` [PATCH v2 13/17] mm: don't TestClearPageError in __filemap_fdatawait_range Jeff Layton
2017-04-12 12:06 ` [PATCH v2 14/17] 9p: set mapping error when writeback fails in launder_page Jeff Layton
2017-04-12 12:06 ` [PATCH v2 15/17] fuse: set mapping error in writepage_locked when it fails Jeff Layton
2017-04-12 12:06 ` [PATCH v2 16/17] cifs: set mapping error when page writeback fails in writepage or launder_pages Jeff Layton
2017-04-12 12:06 ` [PATCH v2 17/17] cifs: remove some unneeded mapping_set_error calls Jeff Layton

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=87pog2rbpd.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /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.