public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joanne Koong <joannelkoong@gmail.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: Hang in generic/648 on zoned btrfs after aa35dd5cbc06 ("iomap: fix invalid folio access after folio_end_read()")
Date: Tue, 10 Mar 2026 14:55:25 -0700	[thread overview]
Message-ID: <CAJnrk1ao_0tp9oe2kisPPgY43YRqrQV=-GHSkgiwx_+WPUPD2Q@mail.gmail.com> (raw)
In-Reply-To: <CAJnrk1YSW5m6mHuFX6cMxZHBt2qdc8aEx9B623WGoTyL1cjjBg@mail.gmail.com>

On Tue, Mar 10, 2026 at 2:08 PM Joanne Koong <joannelkoong@gmail.com> wrote:
>
> On Tue, Mar 10, 2026 at 4:44 AM Johannes Thumshirn
> <Johannes.Thumshirn@wdc.com> wrote:
>
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 867e8ac761c8..03a97361570f 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -543,7 +543,7 @@ static int iomap_read_folio_iter(struct iomap_iter *iter,
>                          * helper, then the helper owns the folio and will end
>                          * the read on it.
>                          */
> -                       if (*bytes_submitted == folio_len)
> +                       if (*bytes_submitted == folio_len || !ifs)
>                                 ctx->cur_folio = NULL;
>                 }

it should be this instead:

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 867e8ac761c8..b803f518adaf 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -497,6 +497,7 @@ static int iomap_read_folio_iter(struct iomap_iter *iter,
        loff_t length = iomap_length(iter);
        struct folio *folio = ctx->cur_folio;
        size_t folio_len = folio_size(folio);
+       struct iomap_folio_state *ifs;
        size_t poff, plen;
        loff_t pos_diff;
        int ret;
@@ -508,7 +509,7 @@ static int iomap_read_folio_iter(struct iomap_iter *iter,
                return iomap_iter_advance(iter, length);
        }

-       ifs_alloc(iter->inode, folio, iter->flags);
+       ifs = ifs_alloc(iter->inode, folio, iter->flags);

        length = min_t(loff_t, length, folio_len - offset_in_folio(folio, pos));
        while (length) {
@@ -543,7 +544,7 @@ static int iomap_read_folio_iter(struct iomap_iter *iter,
                         * helper, then the helper owns the folio and will end
                         * the read on it.
                         */
-                       if (*bytes_submitted == folio_len)
+                       if (*bytes_submitted == folio_len || !ifs)
                                ctx->cur_folio = NULL;
                }

Thanks,
Joanne

  reply	other threads:[~2026-03-10 21:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09 16:37 Hang in generic/648 on zoned btrfs after aa35dd5cbc06 ("iomap: fix invalid folio access after folio_end_read()") Johannes Thumshirn
2026-03-09 20:56 ` Joanne Koong
2026-03-10 11:44   ` Johannes Thumshirn
2026-03-10 21:08     ` Joanne Koong
2026-03-10 21:55       ` Joanne Koong [this message]
2026-03-17  9:34         ` Johannes Thumshirn
2026-03-17 19:48           ` Joanne Koong
2026-03-10 21:59       ` Darrick J. Wong
2026-03-17 19:47         ` 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='CAJnrk1ao_0tp9oe2kisPPgY43YRqrQV=-GHSkgiwx_+WPUPD2Q@mail.gmail.com' \
    --to=joannelkoong@gmail.com \
    --cc=Johannes.Thumshirn@wdc.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