[LTP] [PATCH] epoll_ctl06: Fix BPF map on old kernels
Cyril Hrubis
chrubis@suse.cz
Tue Sep 29 16:40:44 CEST 2026
Hi!
> + case TST_FD_BPF_MAP:
> + /*
> + * The BPF poll callback returns POLLERR for array maps. Without
> + * the callback, poll() returns the default readiness mask.
> + */
> + SAFE_POLL(&pfd, 1, 0);
> + return pfd.revents & POLLERR ? 0 : EPERM;
Should't this be guarded with kernel version? I.e. only enabled for
kernels older than 5.8?
> default:
> return 0;
> }
> @@ -50,7 +61,7 @@ static void run(void)
> TST_FD_FOREACH(fd) {
> efd = SAFE_EPOLL_CREATE1(0);
> ev.data.fd = fd.fd;
> - err = exp_errno(fd.type);
> + err = exp_errno(&fd);
>
> TST_EXP_PASS_OR_FAIL(epoll_ctl(efd, EPOLL_CTL_ADD,
> fd.fd, &ev), err,
>
> ---
> base-commit: 0596b09f22f449cb300e8ad2d08d8b186f551a05
> change-id: 20260929-fix_epoll_bpf-5e472da8e63c
>
> Best regards,
> --
> Andrea Cervesato <andrea.cervesato@suse.com>
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list