Thread (6 messages) 6 messages, 5 authors, 2026-03-06

Re: [PATCH v3 v3 1/2] selftests/harness: order TEST_F and XFAIL_ADD constructors

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-02-26 03:53:17
Also in: linux-kselftest, lkml

On Wed, 25 Feb 2026 19:14:50 +0800 Sun Jian wrote:
TEST_F() allocates and registers its struct __test_metadata via mmap()
inside its constructor, and only then assigns the
_##fixture_##test##_object pointer.

XFAIL_ADD() runs in a constructor too and reads
_##fixture_##test##_object to initialize xfail->test. If XFAIL_ADD runs
first, xfail->test can be NULL and the expected failure will be reported
as FAIL.

Use constructor priorities to ensure TEST_F registration runs before
XFAIL_ADD, without adding extra state or runtime lookups.

Fixes: 2709473c9386 ("selftests: kselftest_harness: support using xfail")
Signed-off-by: Sun Jian <redacted>
Hi Shuah!

Any preference which one of us takes this series?
No real preference here, just slight preference to ship it as 
a fix to 7.0 rather than via -next.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help