From: Matthew Wilcox <willy@infradead.org>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: brauner@kernel.org, djwong@kernel.org, hch@infradead.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] iomap: fix iomap_read_end() for already uptodate folios
Date: Tue, 18 Nov 2025 19:26:30 +0000 [thread overview]
Message-ID: <aRzIZu5e-OaspAWU@casper.infradead.org> (raw)
In-Reply-To: <20251118004421.3500340-1-joannelkoong@gmail.com>
On Mon, Nov 17, 2025 at 04:44:21PM -0800, Joanne Koong wrote:
> There are some cases where when iomap_read_end() is called, the folio
> may already have been marked uptodate. For example, if the iomap block
> needed zeroing, then the folio may have been marked uptodate after the
> zeroing.
>
> iomap_read_end() should unlock the folio instead of calling
> folio_end_read(), which is how these cases were handled prior to commit
> f8eaf79406fe ("iomap: simplify ->read_folio_range() error handling for
> reads"). Calling folio_end_read() on an uptodate folio leads to buggy
> behavior where marking an already uptodate folio as uptodate will XOR it
> to be marked nonuptodate.
>
> Fixes: f8eaf79406fe ("iomap: simplify ->read_folio_range() error handling for reads")
> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> Reported-by: Matthew Wilcox <willy@infradead.org>
Tested-by: Matthew Wilcox (Oracle) <willy@infradead.org>
At least, it gets past generic/008. I'll let the xfstests run continue;
no news is good news.
prev parent reply other threads:[~2025-11-18 19:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 0:44 [PATCH] iomap: fix iomap_read_end() for already uptodate folios Joanne Koong
2025-11-18 5:51 ` Christoph Hellwig
2025-11-18 20:53 ` Joanne Koong
2025-11-18 19:26 ` Matthew Wilcox [this message]
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=aRzIZu5e-OaspAWU@casper.infradead.org \
--to=willy@infradead.org \
--cc=brauner@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=joannelkoong@gmail.com \
--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).