From: Jan Kara <jack@suse.cz>
To: Jeff Layton <jlayton@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, Eryu Guan <eguan@redhat.com>,
Jan Kara <jack@suse.cz>,
linux-ext4@vger.kernel.org
Subject: Re: [PATCH] mm: have filemap_check_and_advance_wb_err clear AS_EIO/AS_ENOSPC
Date: Mon, 25 Sep 2017 10:17:48 +0200 [thread overview]
Message-ID: <20170925081748.GA5741@quack2.suse.cz> (raw)
In-Reply-To: <20170922133331.28812-1-jlayton@kernel.org>
On Fri 22-09-17 09:33:31, Jeff Layton wrote:
> From: Jeff Layton <jlayton@redhat.com>
>
> Eryu noticed that he could sometimes get a leftover error reported when
> it shouldn't be on fsync with ext2 and non-journalled ext4. The problem
> is that writeback_single_inode still uses filemap_fdatawait. That picks
> up a previously set AS_EIO flag, which would ordinarily have been
> cleared before.
>
> Since we're mostly using this function as a replacement for
> filemap_check_errors, have filemap_check_and_advance_wb_err clear AS_EIO
> and AS_ENOSPC when reporting an error. That should allow the new
> function to better emulate the behavior of the old with respect to these
> flags.
>
> Reported-by: Eryu Guan <eguan@redhat.com>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
Looks good. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> mm/filemap.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/mm/filemap.c b/mm/filemap.c
> index 870971e20967..404722ea0fdd 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -620,6 +620,14 @@ int file_check_and_advance_wb_err(struct file *file)
> trace_file_check_and_advance_wb_err(file, old);
> spin_unlock(&file->f_lock);
> }
> +
> + /*
> + * We're mostly using this function as a drop in replacement for
> + * filemap_check_errors. Clear AS_EIO/AS_ENOSPC to emulate the effect
> + * that the legacy code would have had on these flags.
> + */
> + clear_bit(AS_EIO, &mapping->flags);
> + clear_bit(AS_ENOSPC, &mapping->flags);
> return err;
> }
> EXPORT_SYMBOL(file_check_and_advance_wb_err);
> --
> 2.13.5
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2017-09-25 8:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 11:23 [4.14-rc1 bug] fstests generic/441 failure on ext2 Eryu Guan
2017-09-18 12:10 ` Jeff Layton
2017-09-19 14:57 ` Jan Kara
2017-09-19 15:09 ` Jeff Layton
2017-09-20 11:12 ` Jan Kara
2017-09-22 13:33 ` [PATCH] mm: have filemap_check_and_advance_wb_err clear AS_EIO/AS_ENOSPC Jeff Layton
2017-09-25 8:17 ` Jan Kara [this message]
2017-09-25 19:53 ` 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=20170925081748.GA5741@quack2.suse.cz \
--to=jack@suse.cz \
--cc=eguan@redhat.com \
--cc=jlayton@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.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 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).