From: "Theodore Ts'o" <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: Zhang Yi <yi.zhang@huaweicloud.com>,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, adilger.kernel@dilger.ca,
ojaswin@linux.ibm.com, linux@roeck-us.net, yi.zhang@huawei.com,
libaokun1@huawei.com, yukuai3@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH] ext4: fix crash on test_mb_mark_used kunit tests
Date: Fri, 25 Jul 2025 09:15:41 -0400 [thread overview]
Message-ID: <20250725131541.GA184259@mit.edu> (raw)
In-Reply-To: <av5necgeitkiormvqsh75kvgq3arjwxxqxpqievulgz2rvi3dg@75hdi2ubarmr>
On Fri, Jul 25, 2025 at 01:06:18PM +0200, Jan Kara wrote:
> > This patch applies to the kernel that has only merged bbe11dd13a3f
> > ("ext4: fix largest free orders lists corruption on mb_optimize_scan
> > switch"), but not merged 458bfb991155 ("ext4: convert free groups order
> > lists to xarrays").
>
> Hum, I think it would be best to just squash this into bbe11dd13a3f and
> then just rebase & squash the other unittest fixup to the final commit when
> we have to rebase anyway. Because otherwise backports to stable kernel will
> quickly become rather messy.
What I ended up doing was to add a squashed combination of these two
commits and dropped it in before the block allocation scalabiltity
with the following commit description:
ext4: initialize superblock fields in the kballoc-test.c kunit tests
Various changes in the "ext4: better scalability for ext4 block
allocation" patch series have resulted in kunit test failures, most
notably in the test_new_blocks_simple and the test_mb_mark_used tests.
The root cause of these failures is that various in-memory ext4 data
structures were not getting initialized, and while previous versions
of the functions exercised by the unit tests didn't use these
structure members, this was arguably a test bug.
Since one of the patches in the block allocation scalability patches
is a fix which is has a cc:stable tag, this commit also has a
cc:stable tag.
CC: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250714130327.1830534-1-libaokun1@huawei.com
Link: https://patch.msgid.link/20250725021550.3177573-1-yi.zhang@huaweicloud.com
Link: https://patch.msgid.link/20250725021654.3188798-1-yi.zhang@huaweicloud.com
Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/linux-ext4/b0635ad0-7ebf-4152-a69b-58e7e87d5085@roeck-us.net/
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Then in the commit "ext4: convert free groups order lists to xarrays"
which removed list_head, I modified it to remove the linked list
initialization from mballoc-test.c, since that's the commit which
removed those structures.
In the future, we should try to make sure that when we modify data
structures to add or remove struct elements, that we also make sure
that kunit test should also be updated. To that end, I've updated the
kbuild script[1] in xfstests-bld repo so that "kbuild --test" will run
the Kunit tests. Hopefully reducing the friction for running tests
will encourage more kunit tests to be created and so they will kept
under regular maintenance.
[1] https://github.com/tytso/xfstests-bld/blob/master/kernel-build/kbuild
Cheers,
- Ted
next prev parent reply other threads:[~2025-07-25 15:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 2:16 [PATCH] ext4: fix crash on test_mb_mark_used kunit tests Zhang Yi
2025-07-25 11:06 ` Jan Kara
2025-07-25 13:15 ` Theodore Ts'o [this message]
2025-07-26 1:42 ` Zhang Yi
2025-07-26 3:09 ` Theodore Ts'o
2025-07-26 1:47 ` Baokun Li
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=20250725131541.GA184259@mit.edu \
--to=tytso@mit.edu \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=libaokun1@huawei.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=ojaswin@linux.ibm.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yi.zhang@huaweicloud.com \
--cc=yukuai3@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;
as well as URLs for NNTP newsgroup(s).