Skip to content

selftests/bpf: Fix d_path check_mem_access and drop CHECK()

Jonathan Bastari Thamrin b4-sent bpf linux-kselftest lkml 1 version Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected] change-id 20261106-dpath-memfd-ae568d05895f

Versions newest first

  1. v2 Latest2 patches 0 repliesApplied 2/2

Changes in v2 from the cover letter

- Added patch 1 converting CHECK() to ASSERT_*() (Andrii)
- Link to v1: https://lore.kernel.org/bpf/[email protected]/

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2selftests/bpf: Replace d_path CHECK() with ASSERT_*()tools/testing/selftests/bpf/prog_tests/d_path.c+24 -450 repliesApplied
2/2selftests/bpf: Use memfd_create instead of mkstemp in d_pathtools/testing/selftests/bpf/prog_tests/d_path.c+3 -40 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] selftests/bpf: Fix d_path check_mem_access and drop CHECK()

Patch 1 replaces the deprecated CHECK() calls with ASSERT_*().

Patch 2 fixes check_mem_access, which creates a temp file in /dev/shm that isn't mounted under vmtest.sh in local runs. This causes mkstemp() to fail with ENOENT. mkstemp() is replaced with memfd_create() as it gives a shmem-backed file with no mount needed while still reaching vfs_fallocate.

Changes in v2:
- Added patch 1 converting CHECK() to ASSERT_*() (Andrii)
- Link to v1: https://lore.kernel.org/bpf/[email protected]/

---
Jonathan Bastari Thamrin (2):
selftests/bpf: Replace d_path CHECK() with ASSERT_*() selftests/bpf: Use memfd_create instead of mkstemp in d_path

 tools/testing/selftests/bpf/prog_tests/d_path.c | 74 +++++++++----------------
 1 file changed, 26 insertions(+), 48 deletions(-)

---
base-commit: 87eddc739d20b466881e4c5cdd2ddf465a5debfd
change-id: 20261106-dpath-memfd-ae568d05895f

Best regards,

Signature · 1 line
Jonathan Bastari Thamrin <[email protected]>