mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: syzbot <syzbot+fc026e87558558f75c00@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: Re: [syzbot] [f2fs?] kernel BUG in clear_inode (5)
Date: Tue, 01 Sep 2026 06:16:24 -0700	[thread overview]
Message-ID: <6a96d028.a8e469d2.cbf3.5626.GAE@google.com> (raw)
In-Reply-To: <6982985a.a00a0220.37c87e.0017.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [syzbot] [f2fs?] kernel BUG in clear_inode (5)
Author: kth5965@gmail.com

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 786262be6048deab760f68c8acc2c85607165894

Please test the following root-cause fix against the latest upstream tree.

diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index aec06fb4fd76..4047e446ca1d 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -55,7 +55,7 @@ bool f2fs_sanity_check_inline_data(struct inode *inode, struct folio *ifolio)
 		return false;
 
 	if (inode_has_blocks(inode, ifolio))
-		return false;
+		return !f2fs_exist_data(inode);
 
 	if (!support_inline_data(inode))
 		return true;
@@ -221,7 +221,7 @@ int f2fs_convert_inline_inode(struct inode *inode)
 	struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
 	struct dnode_of_data dn;
 	struct f2fs_lock_context lc;
-	struct folio *ifolio, *folio;
+	struct folio *ifolio, *folio = NULL;
 	int err = 0;
 
 	if (f2fs_hw_is_readonly(sbi) || f2fs_readonly(sbi->sb))
@@ -234,10 +234,7 @@ int f2fs_convert_inline_inode(struct inode *inode)
 	if (err)
 		return err;
 
-	folio = f2fs_grab_cache_folio(inode->i_mapping, 0, false);
-	if (IS_ERR(folio))
-		return PTR_ERR(folio);
-
+retry:
 	f2fs_lock_op(sbi, &lc);
 
 	ifolio = f2fs_get_inode_folio(sbi, inode->i_ino);
@@ -248,6 +245,21 @@ int f2fs_convert_inline_inode(struct inode *inode)
 
 	set_new_dnode(&dn, inode, ifolio, ifolio, 0);
 
+	/*
+	 * Keep the folio #0 -> inode folio lock order while checking
+	 * FI_DATA_EXIST under the inode folio lock.
+	 */
+	if (!folio && f2fs_has_inline_data(inode) && f2fs_exist_data(inode)) {
+		f2fs_put_dnode(&dn);
+		f2fs_unlock_op(sbi, &lc);
+
+		folio = f2fs_grab_cache_folio(inode->i_mapping, 0, false);
+		if (IS_ERR(folio))
+			return PTR_ERR(folio);
+
+		goto retry;
+	}
+
 	if (f2fs_has_inline_data(inode))
 		err = f2fs_convert_inline_folio(&dn, folio);
 

      parent reply	other threads:[~2026-09-01 13:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04  0:52 syzbot
2026-02-05 11:55 ` Forwarded: #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f14faaf3a1fb3b9e4cf2e56269711fb85fba9458 syzbot
2026-02-24 14:44 ` Forwarded: Re: [syzbot] [f2fs?] kernel BUG in clear_inode (5) syzbot
2026-02-24 14:52 ` syzbot
2026-03-28 15:41 ` Forwarded: Re: [syzbot] [f2fs?] kernel BUG in clear_inode syzbot
2026-03-28 15:47 ` syzbot
2026-03-28 16:17 ` syzbot
2026-09-01 13:16 ` syzbot [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=6a96d028.a8e469d2.cbf3.5626.GAE@google.com \
    --to=syzbot+fc026e87558558f75c00@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

all inboxes | Powered by JetHome®