archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <>
To: Xianting Tian <>
Subject: Re: [PATCH] mm/filemap.c: clear page error before actual read
Date: Tue, 3 Mar 2020 08:43:17 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Tue, Mar 03, 2020 at 10:09:50AM -0500, Xianting Tian wrote:
> This patch is to add the calling of ClearPageError just before the
> actual read of read path of cramfs mount.

Thank you for your patch and your analysis.  I concur; an error set
on a page will not be cleared by doing a subsequent read.  This is
probably an oversight; in generic_file_buffered_read(), we do:

                /* Start the actual read. The read will unlock the page. */
                error = mapping->a_ops->readpage(filp, page);

and also in filemap_fault:

        fpin = maybe_unlock_mmap_for_io(vmf, fpin);
        error = mapping->a_ops->readpage(file, page);

That said, a freshly allocated page will not have PageError set on
it, so I would prefer to see this:

        /* Someone else locked and filled the page in a very small window */
        if (PageUptodate(page)) {
                goto out;
+	ClearPageError(page);
        goto filler;

  reply	other threads:[~2020-03-03 16:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 15:09 [PATCH] mm/filemap.c: clear page error before actual read Xianting Tian
2020-03-03 16:43 ` Matthew Wilcox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-03-04 10:47 Xianting Tian
2020-03-04 12:15 ` Matthew Wilcox
2020-03-03  8:25 Xianting Tian
2020-04-21  3:42 ` Andrew Morton
2020-03-03  7:18 Xianting Tian

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:

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

  git send-email \ \ \ \ \ \ \

* 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).