From: Sasha Levin <sashal@kernel.org>
To: Ming Lei <tom.leiming@gmail.com>, Jens Axboe <axboe@kernel.dk>
Cc: Uday Shankar <ushankar@purestorage.com>,
Shuah Khan <shuah@kernel.org>,
linux-block@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2] selftests/ublk: use the configured kernel UAPI headers
Date: Thu, 26 Nov 2026 18:17:06 -0500 [thread overview]
Message-ID: <20261126231706.1303486-1-sashal@kernel.org> (raw)
With generated headers in an output directory, the hardcoded source-tree
include path falls through to distribution headers. New ublk flags and
structure members, including UBLK_F_IO_DESC_SIZE, are then missing.
Use KHDR_INCLUDES to consume the headers from the kernel under test, and
add the headers target as an order-only prerequisite of the ublk
programs, as nolibc-test does, so that a standalone build installs them
first. Baseline builds fail on the missing definitions; GCC 14 and Clang
21 builds succeed with the output-directory headers and target liburing
development files available.
Fixes: e371b9d3368c ("selftests: ublk: kublk: fix include path")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Changes since v1:
- Rebased onto v7.4-rc3, where 3197517875fd ("selftests: ublk: fix the
build and file offsets on 32-bit") touches the same lines. No other
change.
KernelCI's kselftest builds of mainline 9437ee8b6cf6 still fail on
kublk, metadata_size and ublk_cancel_ready without this, with gcc and
clang on arm64 and x86 and with gcc on arm, on undefined UBLK_F_* flags,
struct ublk_param_integrity and FS_IOC_GETLBMD_CAP.
v1: https://lore.kernel.org/r/20261014200144.1364828-1-sashal@kernel.org
tools/testing/selftests/ublk/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ublk/Makefile b/tools/testing/selftests/ublk/Makefile
index 1a50d4695c9fa..8fc3291eaed94 100644
--- a/tools/testing/selftests/ublk/Makefile
+++ b/tools/testing/selftests/ublk/Makefile
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
-CFLAGS += -O3 -Wl,-no-as-needed -Wall -I $(top_srcdir)/usr/include
+CFLAGS += -O3 -Wl,-no-as-needed -Wall $(KHDR_INCLUDES)
CFLAGS += -D_FILE_OFFSET_BITS=64
ifneq ($(WERROR),0)
CFLAGS += -Werror
@@ -86,6 +86,7 @@ include ../lib.mk
$(OUTPUT)/kublk: $(filter-out $(STANDALONE_UTILS),$(wildcard *.c))
$(OUTPUT)/ublk_cancel_ready: ublk_cancel_ready.c ctrl.c
+$(TEST_GEN_PROGS_EXTENDED): | headers
check:
shellcheck -x -f gcc *.sh
base-commit: 666539eecdf4db623f5e3c3e55cf9f2dfad24aa4
--
2.53.0
next reply other threads:[~2026-11-26 23:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 23:17 Sasha Levin [this message]
2026-11-27 8:09 ` [PATCH v2] selftests/ublk: use the configured kernel UAPI headers Ming Lei
2026-11-28 2:47 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2026-11-03 13:01 Sasha Levin
2026-11-03 14:06 ` Ming Lei
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=20261126231706.1303486-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=tom.leiming@gmail.com \
--cc=ushankar@purestorage.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.