BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf:syscall: Log error code on trampoline unlink failure
@ 2026-07-16  3:34 xu.xin16
  2026-07-16  3:45 ` sashiko-bot
  2026-07-16  4:58 ` Leon Hwang
  0 siblings, 2 replies; 9+ messages in thread
From: xu.xin16 @ 2026-07-16  3:34 UTC (permalink / raw)
  To: ast, daniel, john.fastabend, andrii, eddyz87, memxor, martin.lau,
	song, yonghong.song, jolsa, emil, bpf, linux-kernel
  Cc: xu.xin16, xu.xin

From: xu xin <xu.xin16@zte.com.cn>

Replace silent WARN_ON_ONCE with WARN_ONCE that prints the actual error
code from bpf_trampoline_unlink_prog(). This aids debugging of race
conditions during link teardown, while keeping the warning rate limited
to avoid log flooding.

Signed-off-by: xu xin <xu.xin16@zte.com.cn>
---
 kernel/bpf/syscall.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 6db306d23b47..2348dc33abf4 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -3626,10 +3626,13 @@ static void bpf_tracing_link_release(struct bpf_link *link)
 {
 	struct bpf_tracing_link *tr_link =
 		container_of(link, struct bpf_tracing_link, link.link);
+	int err;

-	WARN_ON_ONCE(bpf_trampoline_unlink_prog(&tr_link->link.node,
-						tr_link->trampoline,
-						tr_link->tgt_prog));
+	err = bpf_trampoline_unlink_prog(&tr_link->link.node,
+					tr_link->trampoline,
+					tr_link->tgt_prog);
+	if (err)
+		WARN_ONCE(err, "bpf_trampoline_unlink_prog returns error: %d\n", err);

 	bpf_trampoline_put(tr_link->trampoline);

-- 
2.25.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-07-16  8:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16  3:34 [PATCH bpf-next] bpf:syscall: Log error code on trampoline unlink failure xu.xin16
2026-07-16  3:45 ` sashiko-bot
2026-07-16  4:58 ` Leon Hwang
2026-07-16  5:55   ` xu.xin16
2026-07-16  6:09     ` Leon Hwang
2026-07-16  6:26       ` xu.xin16
2026-07-16  6:56         ` Leon Hwang
2026-07-16  7:03           ` xu.xin16
2026-07-16  8:01             ` Leon Hwang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox