Re: [PATCH bpf-next 3/5] selftests/bpf: Use /tmp for temporary file in d_path

From: Ihor Solodrai

Date: Tue Oct 06 2026 - 13:09:56 EST


On 10/5/26 3:54 PM, Ihor Solodrai wrote:
> On 9/29/26 11:24 PM, Pu Lehui wrote:
>>
>> On 2026/9/30 0:29, Alexei Starovoitov wrote:
>>> On Tue, Sep 29, 2026 at 08:39 AM Pu Lehui <pulehui@xxxxxxxxxxxxxxx> wrote:
>>>> The failure occurs because the rootfs created by libbpf/ci [0] does not
>>>> mount /dev/shm, causing temporary file creation under /dev/shm to fail.
>>>>
>>>> Let's switch to using /tmp instead to fix this issue.
>>>
>>> This will break BPF CI.
>>> The test was using /tmp up to v4 and was moved to /dev/shm in v5,
>>> since /tmp is on 9p in BPF CI and 9p doesn't support fallocate. See
>>> https://lore.kernel.org/all/20251206141210.3148-1-electronlsr@xxxxxxxxx/
>>> vmtest's init mounts tmpfs at /dev/shm, /run and /mnt, but not at /tmp.
>>> So fallocate() will return EOPNOTSUPP and d_path/check_mem_access
>>> will fail on x86, arm64 and s390.
>>>
>>> Mount tmpfs at /dev/shm in mkrootfs_tweak.sh like you did for /tmp in [1]
>>> and drop this patch.
>>>
>>> pw-bot: cr
>>
>> Hi Alexei and Ihor,
>>
>> I have been make a pr for mount tmpfs at /dev/shm, pls take a look.
>>
>> https://github.com/libbpf/ci/pull/239
>
>
> Merged, thanks.

Pu Lehui,

I just realized that this change may not be enough.

If you want to make sure the selftests will run properly in BPF CI,
please try the vmtest tool (a qemu wrapper):
https://github.com/danobi/vmtest

You should be able to run riscv64 in emulation through it.