From: "Zhao Gongyi" <zhaogongyi@bytedance.com>
To: "Andreas Dilger" <adilger@dilger.ca>
Cc: <linux-ext4@vger.kernel.org>, <tytso@mit.edu>,
<libaokun@linux.alibaba.com>, <jack@suse.cz>,
<ojaswin@linux.ibm.com>, <ritesh.list@gmail.com>,
<yi.zhang@huawei.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ext4: reject impossible group free cluster counts
Date: Tue, 3 Nov 2026 10:58:38 +0800 [thread overview]
Message-ID: <2c1663e5-fac2-4346-ab2a-b35ae652373a@bytedance.com> (raw)
In-Reply-To: <F238B62D-6BED-4D64-B099-B956B820BA44@dilger.ca>
Hi Andreas,
Thanks for the review.
On 11/3/26 6:10 AM, Andreas Dilger wrote:
>
> I think a lot of this class of bug could be avoided by doing very minimal
> checks on the group descriptors initially (and other metadata, enough to
> load and validate the journal inode itself is sane). The journal inode is
> otherwise read-only so its allocations should never be modified. Then
> replaying the journal if it is dirty, and restarting the superblock/GDT
> checks from the beginning to validate the _current_ blocks are sane.
>
> That should only be done once per mount. To keep sanity after checks, we
> could validate the journal never contains updates to its own inode (or at
> least not until an SMR "wandering journal/log structure" feature exists).
Agreed. The post-recovery check in v1 is too narrow: it uses the live
superblock geometry, which journal replay may also have changed, and
leaves the other replayed group descriptor fields unchecked.
I will rework v2 so that only the checks needed to safely load the
journal are done before recovery, followed by full superblock geometry
and group descriptor validation after replay and before free-space
accounting. I will also check which existing validation helpers can be
safely rerun without duplicating initialization side effects.
Validating that the journal does not update its own inode also sounds
useful. If that requires broader journal changes, I will handle it
separately.
Thanks,
Gongyi
prev parent reply other threads:[~2026-11-03 2:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 4:24 [PATCH] ext4: reject impossible group free cluster counts Zhao Gongyi
2026-11-02 4:38 ` sashiko-bot
2026-11-02 21:46 ` Jan Kara
2026-11-02 22:10 ` Andreas Dilger
2026-11-03 2:58 ` Zhao Gongyi [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=2c1663e5-fac2-4346-ab2a-b35ae652373a@bytedance.com \
--to=zhaogongyi@bytedance.com \
--cc=adilger@dilger.ca \
--cc=jack@suse.cz \
--cc=libaokun@linux.alibaba.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=tytso@mit.edu \
--cc=yi.zhang@huawei.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