From: sashiko-bot@kernel.org
To: "Jonathan Bastari Thamrin" <thamrinjonathan@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next] selftests/bpf: Use memfd_create instead of mkstemp in d_path
Date: Mon, 02 Nov 2026 04:19:44 +0000 [thread overview]
Message-ID: <sashiko-outbox-192887@kernel.org> (raw)
In-Reply-To: <20261102-d-path-memfd-v1-1-692a5664b36d@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] selftests/bpf: deprecated CHECK() used in test_d_path_mem_access()
--
commit 70ec4540d31dab1fed0411808b9f6ef87d380925
Author: Jonathan Bastari Thamrin <thamrinjonathan@gmail.com>
selftests/bpf: Use memfd_create instead of mkstemp in d_path
This commit replaces mkstemp() in /dev/shm with memfd_create() in
test_d_path_mem_access() so the check_mem_access subtest can run under
vmtest.sh when /dev/shm is not mounted.
> diff --git a/tools/testing/selftests/bpf/prog_tests/d_path.c b/tools/testing/selftests/bpf/prog_tests/d_path.c
> index 1a2a2f1abf033..0f0150d73262b 100644
> --- a/tools/testing/selftests/bpf/prog_tests/d_path.c
> +++ b/tools/testing/selftests/bpf/prog_tests/d_path.c
[ ... ]
> @@ -230,13 +230,12 @@ static void test_d_path_mem_access(void)
>
> bss = skel->bss;
>
> - localfd = mkstemp(path_template);
> - if (CHECK(localfd < 0, "trigger", "mkstemp failed\n"))
> + localfd = memfd_create("d_path_loadgen", 0);
> + if (CHECK(localfd < 0, "trigger", "memfd_create failed\n"))
> goto cleanup;
[Severity: Low]
This isn't a bug, but since CHECK() is deprecated in BPF selftests, should
this updated check in test_d_path_mem_access() use ASSERT_OK_FD() from
tools/testing/selftests/bpf/test_progs.h instead (similar to commit
47687a29b2c3 ("selftests/bpf: Use memfd_create instead of shm_open in
cgroup_iter_memcg"))?
if (!ASSERT_OK_FD(localfd, "memfd_create"))
goto cleanup;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261102-d-path-memfd-v1-1-692a5664b36d@gmail.com?part=1
prev parent reply other threads:[~2026-11-02 4:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 4:15 [PATCH bpf-next] selftests/bpf: Use memfd_create instead of mkstemp in d_path Jonathan Bastari Thamrin
2026-11-02 4:15 ` Jonathan Bastari Thamrin via B4 Relay
2026-11-02 4:19 ` sashiko-bot [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=sashiko-outbox-192887@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=thamrinjonathan@gmail.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.