]> Gentwo Git Trees - linux/.git/commit
selftests/bpf: Fix htab_update/reenter_update selftest failure
authorSaket Kumar Bhaskar <skb99@linux.ibm.com>
Mon, 17 Nov 2025 06:07:52 +0000 (11:37 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 25 Nov 2025 00:48:28 +0000 (16:48 -0800)
commit590699d85823f38b74d52a0811ef22ebb61afddc
tree29fd6c30d19fdf9c4f8927c7551194ef3bde9cf2
parent4617b3069af411ce64a0c876b1b4964a3ea2b3f4
selftests/bpf: Fix htab_update/reenter_update selftest failure

Since commit 31158ad02ddb ("rqspinlock: Add deadlock detection
and recovery") the updated path on re-entrancy now reports deadlock
via -EDEADLK instead of the previous -EBUSY.

Also, the way reentrancy was exercised (via fentry/lookup_elem_raw)
has been fragile because lookup_elem_raw may be inlined
(find_kernel_btf_id() will return -ESRCH).

To fix this fentry is attached to bpf_obj_free_fields() instead of
lookup_elem_raw() and:

- The htab map is made to use a BTF-described struct val with a
  struct bpf_timer so that check_and_free_fields() reliably calls
  bpf_obj_free_fields() on element replacement.

- The selftest is updated to do two updates to the same key (insert +
  replace) in prog_test.

- The selftest is updated to align with expected errno with the
  kernel’s current behavior.

Signed-off-by: Saket Kumar Bhaskar <skb99@linux.ibm.com>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Link: https://lore.kernel.org/r/20251117060752.129648-1-skb99@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/htab_update.c
tools/testing/selftests/bpf/progs/htab_update.c