From: Matthew Wilcox <willy@infradead.org>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>,
brauner@kernel.org, djwong@kernel.org, bfoster@redhat.com,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v4 1/1] iomap: fix invalid folio access after folio_end_read()
Date: Mon, 26 Jan 2026 21:42:11 +0000 [thread overview]
Message-ID: <aXffs1jcO0u85KpO@casper.infradead.org> (raw)
In-Reply-To: <CAJnrk1aQ8s04Co_Ncd41EpbMJEexPEF2qtAhGnG1rop8LLvWHA@mail.gmail.com>
On Mon, Jan 26, 2026 at 01:36:21PM -0800, Joanne Koong wrote:
> I don't think there's a separate bug. The number of bytes submitted
> is tracked per-folio across iterations/mappings. If the first call to
> iomap_iter() succeeds and the second one fails, iomap_read_folio()
> still calls iomap_read_end() and decrements ifs->read_bytes_pending /
> does any folio unlocking it might need to do.
>
> This change to iomap_read_folio() is a fix for the original bug (eg
> for folios without an ifs, the IO helper might have already called
> folio_end_read(), so ctx->cur_folio() needs to be used instead of the
> direct folio pointer).
Oh yes, I got confused. You're right.
> I'll drop the change for the new iomap_read_submit_and_end() helper
> and submit that later as a separate patch to Christian's tree.
I don't think it deserves to be factored out into a separate function,
honestly.
next prev parent reply other threads:[~2026-01-26 21:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 23:56 [PATCH v4 0/1] iomap: fix invalid folio access after folio_end_read() Joanne Koong
2026-01-23 23:56 ` [PATCH v4 1/1] " Joanne Koong
2026-01-26 5:46 ` Christoph Hellwig
2026-01-26 14:55 ` Matthew Wilcox
2026-01-26 14:59 ` Christoph Hellwig
2026-01-26 21:36 ` Joanne Koong
2026-01-26 21:42 ` Matthew Wilcox [this message]
2026-01-26 22:10 ` Joanne Koong
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=aXffs1jcO0u85KpO@casper.infradead.org \
--to=willy@infradead.org \
--cc=bfoster@redhat.com \
--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