From: Yang Xiuwei <yangxiuwei@kylinos.cn>
To: axboe@kernel.dk
Cc: io-uring@vger.kernel.org
Subject: Re: [PATCH 2/2] test/cbpf_filter: skip when openat2.h is not available
Date: Sun, 15 Mar 2026 13:02:17 +0800 [thread overview]
Message-ID: <20260315050217.121292-1-yangxiuwei@kylinos.cn> (raw)
In-Reply-To: <10b4b9bf-2dc8-41f3-bed2-110170dff236@kernel.dk>
Hi Jens,
On 2026-03-14 13:35 UTC, Jens Axboe wrote:
> liburing defines open_how if it's not in the system headers. I feel
> like all you need to do here is remove the openat2.h include, rather
> than disable the test entirely?
Thanks for the suggestion. I had actually tried that first: removing only the
#include <linux/openat2.h> and relying on liburing's compat for struct open_how.
It turned out that this test also uses the RESOLVE_IN_ROOT macro (and the
filter logic is built around it). Without the header, the build fails with
'RESOLVE_IN_ROOT' undeclared. RESOLVE_IN_ROOT and the other RESOLVE_* flags
come from <linux/openat2.h>; compat.h only provides struct open_how when the
header is missing, not those constants.
Defining RESOLVE_IN_ROOT (and friends) ourselves in compat or in the test
would duplicate kernel UAPI and could get out of sync if the kernel ever
changes them. So I went back to the more conservative approach: wrap the
test in #ifdef CONFIG_HAVE_OPEN_HOW and provide a stub main that returns
T_EXIT_SKIP when openat2.h is not available. The test then always compiles;
on systems without the header it simply skips at runtime.
If you have a better approach in mind, I'd be glad to follow that instead.
Best regards,
Yang Xiuwei
prev parent reply other threads:[~2026-03-15 5:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-14 8:35 [PATCH Liburing 0/2] build and compiler warning fixes Yang Xiuwei
2026-03-14 8:35 ` [PATCH 1/2] examples/send-zerocopy: fix -Wstringop-truncation on ifr.ifr_name Yang Xiuwei
2026-03-14 8:35 ` [PATCH 2/2] test/cbpf_filter: skip when openat2.h is not available Yang Xiuwei
2026-03-14 13:35 ` Jens Axboe
2026-03-15 5:02 ` Yang Xiuwei [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=20260315050217.121292-1-yangxiuwei@kylinos.cn \
--to=yangxiuwei@kylinos.cn \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
/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