From: Chao Yu <chao@kernel.org>
To: Zhan Xusheng <zhanxusheng1024@gmail.com>,
Jaegeuk Kim <jaegeuk@kernel.org>
Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, Guikun Yang <yangguikun19@qq.com>,
zhanxusheng@xiaomi.com, stable@kernel.org
Subject: Re: [PATCH] f2fs: don't BUG_ON a missing orphan inode at mount
Date: Wed, 11 Nov 2026 16:30:48 +0800 [thread overview]
Message-ID: <acb8e08b-4a9f-4419-8b1b-b1933800311b@kernel.org> (raw)
In-Reply-To: <20261105034419.2701443-1-zhanxusheng1024@gmail.com>
On 11/5/26 11:44, Zhan Xusheng wrote:
> From: Zhan Xusheng <zhanxusheng@xiaomi.com>
>
> recover_orphan_inode() treats -ENOENT from f2fs_iget() as a kernel
> bug, but the ino comes from the on-disk orphan block. An image whose
> orphan entry names an inode without a NAT entry hits the BUG_ON at
> mount with CONFIG_F2FS_CHECK_FS, or a WARN and a failed mount
> without it.
>
> To reproduce, unlink a file while it is still open, sync, crash,
> then change ino[0] in the checkpoint's orphan block to an unused
> nid and mount:
>
> kernel BUG at fs/f2fs/checkpoint.c:967!
> RIP: 0010:f2fs_recover_orphan_inodes+0x6a3/0x9a0
>
> Treat it as corruption, the same way the entry_count check does:
> fail the mount with -EFSCORRUPTED and record
> ERROR_INCONSISTENT_ORPHAN for fsck.
>
> Fixes: 8c14bfadeac2 ("f2fs: handle error of f2fs_iget correctly")
> Reported-by: Guikun Yang <yangguikun19@qq.com>
> Closes: https://lore.kernel.org/linux-f2fs-devel/tencent_B30A444DF94444D1A63A7D6F8E2039F1990A@qq.com/
> Cc: stable@kernel.org
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
prev parent reply other threads:[~2026-11-11 8:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 8:00 f2fs: orphan entry pointing at an inode with no NAT entry triggers f2fs_bug_on() in recover_orphan_inode() - kernel BUG at mount with CONFIG_F2FS_CHECK_FS Guikun Yang
2026-11-05 3:44 ` [PATCH] f2fs: don't BUG_ON a missing orphan inode at mount Zhan Xusheng
2026-11-11 8:30 ` Chao Yu [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=acb8e08b-4a9f-4419-8b1b-b1933800311b@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--cc=yangguikun19@qq.com \
--cc=zhanxusheng1024@gmail.com \
--cc=zhanxusheng@xiaomi.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®