Skip to content

Commit 902a79b

Browse files
ameryhungMartin KaFai Lau
authored andcommitted
selftests/bpf: Update task_local_storage/task_storage_nodeadlock test
Adjust the error code we are checking against as bpf_task_storage_delete() now returns -EDEADLK or -ETIMEDOUT when deadlock happens. Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Amery Hung <ameryhung@gmail.com> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://patch.msgid.link/20260205222916.1788211-15-ameryhung@gmail.com
1 parent e477203 commit 902a79b

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

tools/testing/selftests/bpf/progs/task_storage_nodeadlock.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
// SPDX-License-Identifier: GPL-2.0
22

33
#include "vmlinux.h"
4+
#include <errno.h>
45
#include <bpf/bpf_helpers.h>
56
#include <bpf/bpf_tracing.h>
67

78
char _license[] SEC("license") = "GPL";
89

9-
#ifndef EBUSY
10-
#define EBUSY 16
11-
#endif
12-
1310
extern bool CONFIG_PREEMPTION __kconfig __weak;
1411
int nr_get_errs = 0;
1512
int nr_del_errs = 0;
@@ -40,7 +37,7 @@ int BPF_PROG(socket_post_create, struct socket *sock, int family, int type,
4037

4138
ret = bpf_task_storage_delete(&task_storage,
4239
bpf_get_current_task_btf());
43-
if (ret == -EBUSY)
40+
if (ret == -EDEADLK || ret == -ETIMEDOUT)
4441
__sync_fetch_and_add(&nr_del_errs, 1);
4542

4643
return 0;

0 commit comments

Comments
 (0)