From: syzbot <syzbot+9013411dc43f3582823a@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [PATCH] gfs2: fix hung task in gfs2_jhead_process_page
Date: Mon, 23 Mar 2026 19:30:49 -0700 [thread overview]
Message-ID: <69c1f759.a70a0220.3cae05.0006.GAE@google.com> (raw)
In-Reply-To: <69c19ef0.050a0220.3bf4de.00a9.GAE@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: [PATCH] gfs2: fix hung task in gfs2_jhead_process_page
Author: kartikey406@gmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
filemap_get_folio() can return an ERR_PTR if the folio is not
present in the page cache. This can happen when a crafted or
corrupted GFS2 filesystem image is mounted and journal recovery
is triggered.
gfs2_jhead_process_page() calls filemap_get_folio() without
checking the return value, and passes the result directly to
folio_wait_locked(). When an ERR_PTR is passed to
folio_wait_locked(), the kernel task gets stuck in uninterruptible
sleep (state D) forever, triggering the hung task watchdog.
Fix this by checking the return value of filemap_get_folio().
If the folio is not found, record the error via filemap_set_wb_err()
so that gfs2_find_jhead() picks it up through filemap_check_wb_err()
and returns a proper error code to the caller. Without this,
gfs2_find_jhead() would return success despite the failure, leading
to further issues during mount such as duplicate kmem_cache creation.
Reported-by: syzbot+9013411dc43f3582823a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=9013411dc43f3582823a
Signed-off-by: Deepanshu Kartikey <Kartikey406@gmail.com>
---
fs/gfs2/lops.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 797931eb5845..a832904a09e3 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -467,6 +467,12 @@ static void gfs2_jhead_process_page(struct gfs2_jdesc *jd, unsigned long index,
folio = filemap_get_folio(jd->jd_inode->i_mapping, index);
+ if (IS_ERR(folio)) {
+ filemap_set_wb_err(jd->jd_inode->i_mapping, PTR_ERR(folio));
+ *done = true;
+ return;
+ }
+
folio_wait_locked(folio);
if (!folio_test_uptodate(folio))
*done = true;
--
2.43.0
next prev parent reply other threads:[~2026-03-24 2:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 20:13 [syzbot] [gfs2?] INFO: task hung in gfs2_recover_journal (4) syzbot
2026-03-24 1:49 ` Forwarded: [PATCH] gfs2: fix hung task in gfs2_jhead_process_page syzbot
2026-03-24 2:30 ` syzbot [this message]
2026-03-24 9:27 ` Forwarded: [PATCH] gfs2: fix duplicate kmem_cache on repeated mount failure syzbot
2026-03-25 7:37 ` [syzbot] [gfs2?] INFO: task hung in gfs2_recover_journal (4) Edward Adam Davis
2026-03-25 8:18 ` syzbot
2026-03-25 7:49 ` Edward Adam Davis
2026-03-25 8:30 ` syzbot
2026-03-25 7:50 ` [PATCH] gfs2: prevent corrupt data from entering jextent Edward Adam Davis
2026-03-25 10:25 ` [syzbot] [gfs2?] INFO: task hung in gfs2_recover_journal (4) Edward Adam Davis
2026-03-25 11:24 ` syzbot
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=69c1f759.a70a0220.3cae05.0006.GAE@google.com \
--to=syzbot+9013411dc43f3582823a@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzkaller-bugs@googlegroups.com \
/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
Powered by JetHome