[PATCH bpf-next] selftests/bpf: don't exit on failed bpf_testmod unload

Subsystems: bpf [general] (safe dynamic programs and tools), bpf [selftests] (test runners & infrastructure), kernel selftest framework, the rest

DORMANTno replies LANDED

Landed in mainline as 86ce322d21eb on 2021-01-26.

2 messages, 2 authors, 2021-01-26 · open the first message on its own page

[PATCH bpf-next] selftests/bpf: don't exit on failed bpf_testmod unload

From: Andrii Nakryiko <andrii@kernel.org>
Date: 2021-01-26 18:46:14

Fix bug in handling bpf_testmod unloading that will cause test_progs exiting
prematurely if bpf_testmod unloading failed. This is especially problematic
when running a subset of test_progs that doesn't require root permissions and
doesn't rely on bpf_testmod, yet will fail immediately due to exit(1) in
unload_bpf_testmod().

Fixes: 9f7fa225894c ("selftests/bpf: Add bpf_testmod kernel module for testing")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
 tools/testing/selftests/bpf/test_progs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index 213628ee721c..6396932b97e2 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -390,7 +390,7 @@ static void unload_bpf_testmod(void)
 			return;
 		}
 		fprintf(env.stderr, "Failed to unload bpf_testmod.ko from kernel: %d\n", -errno);
-		exit(1);
+		return;
 	}
 	if (env.verbosity > VERBOSE_NONE)
 		fprintf(stdout, "Successfully unloaded bpf_testmod.ko.\n");
-- 
2.24.1

Re: [PATCH bpf-next] selftests/bpf: don't exit on failed bpf_testmod unload

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-01-26 16:11:20

Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

On Mon, 25 Jan 2021 22:50:18 -0800 you wrote:
Fix bug in handling bpf_testmod unloading that will cause test_progs exiting
prematurely if bpf_testmod unloading failed. This is especially problematic
when running a subset of test_progs that doesn't require root permissions and
doesn't rely on bpf_testmod, yet will fail immediately due to exit(1) in
unload_bpf_testmod().

Fixes: 9f7fa225894c ("selftests/bpf: Add bpf_testmod kernel module for testing")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>

[...]
Here is the summary with links:
  - [bpf-next] selftests/bpf: don't exit on failed bpf_testmod unload
    https://git.kernel.org/bpf/bpf-next/c/86ce322d21eb

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help