Skip to content

Commit 8faf8ef

Browse files
committed
selftests/bpf: Update task_local_storage/task_storage_nodeadlock test
Adjsut the error code we are checking against as bpf_task_storage_get() now returns -EDEADLK or -ETIMEDOUT when deadlock happens. Signed-off-by: Amery Hung <[email protected]>
1 parent 74455b5 commit 8faf8ef

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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)