From: Chao Yu <chao@kernel.org>
To: Zhan Xusheng <zhanxusheng1024@gmail.com>, jaegeuk@kernel.org
Cc: chao@kernel.org, yangguikun19@qq.com,
linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, zhanxusheng@xiaomi.com,
stable@vger.kernel.org
Subject: Re: [PATCH] f2fs: don't BUG_ON an inconsistent node ino in roll-forward recovery
Date: Tue, 1 Dec 2026 16:12:54 +0800 [thread overview]
Message-ID: <c2b767f2-e237-4a21-88a9-039342a8e2d0@kernel.org> (raw)
In-Reply-To: <20261125073956.2927907-1-zhanxusheng1024@gmail.com>
On 11/25/26 15:39, Zhan Xusheng wrote:
> From: Zhan Xusheng <zhanxusheng@xiaomi.com>
>
> do_recover_data() asserts that the ino in the NAT entry of the node it
> recovers into matches the ino in the footer of the fsynced node block.
> Both are read from disk and nothing checks one against the other
> before, so mounting an image with a wrong ino in that NAT entry hits
> the f2fs_bug_on(): a kernel BUG with CONFIG_F2FS_CHECK_FS, and without
> it a warning, after which the NAT ino is written into the footer of the
> recovered node.
>
> To reproduce, create a file, sync, write and fsync it, crash, and change
> the ino of the file's entry in the NAT journal of the checkpoint pack.
> The next mount gives:
>
> kernel BUG at fs/f2fs/recovery.c:698!
>
> Fail the recovery with -EFSCORRUPTED instead, as the ofs_of_node check
> right after it does.
>
> Reported-by: Guikun Yang <yangguikun19@qq.com>
> Closes: https://lore.kernel.org/all/tencent_5CEF90115E2715D386A8349FCA28D7D4D607@qq.com/
> Cc: stable@vger.kernel.org
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Zhan Xusheng <zhanxusheng1024@gmail.com>, jaegeuk@kernel.org
Cc: zhanxusheng@xiaomi.com, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net,
yangguikun19@qq.com
Subject: Re: [f2fs-dev] [PATCH] f2fs: don't BUG_ON an inconsistent node ino in roll-forward recovery
Date: Tue, 1 Dec 2026 16:12:54 +0800 [thread overview]
Message-ID: <c2b767f2-e237-4a21-88a9-039342a8e2d0@kernel.org> (raw)
In-Reply-To: <20261125073956.2927907-1-zhanxusheng1024@gmail.com>
On 11/25/26 15:39, Zhan Xusheng wrote:
> From: Zhan Xusheng <zhanxusheng@xiaomi.com>
>
> do_recover_data() asserts that the ino in the NAT entry of the node it
> recovers into matches the ino in the footer of the fsynced node block.
> Both are read from disk and nothing checks one against the other
> before, so mounting an image with a wrong ino in that NAT entry hits
> the f2fs_bug_on(): a kernel BUG with CONFIG_F2FS_CHECK_FS, and without
> it a warning, after which the NAT ino is written into the footer of the
> recovered node.
>
> To reproduce, create a file, sync, write and fsync it, crash, and change
> the ino of the file's entry in the NAT journal of the checkpoint pack.
> The next mount gives:
>
> kernel BUG at fs/f2fs/recovery.c:698!
>
> Fail the recovery with -EFSCORRUPTED instead, as the ofs_of_node check
> right after it does.
>
> Reported-by: Guikun Yang <yangguikun19@qq.com>
> Closes: https://lore.kernel.org/all/tencent_5CEF90115E2715D386A8349FCA28D7D4D607@qq.com/
> Cc: stable@vger.kernel.org
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2026-12-01 8:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 7:39 [PATCH] f2fs: don't BUG_ON an inconsistent node ino in roll-forward recovery Zhan Xusheng
2026-11-25 7:39 ` [f2fs-dev] " Zhan Xusheng
2026-12-01 8:12 ` Chao Yu [this message]
2026-12-01 8:12 ` Chao Yu via Linux-f2fs-devel
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=c2b767f2-e237-4a21-88a9-039342a8e2d0@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@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.