From: Daan De Meyer <daan.j.demeyer@gmail.com>
To: bpf@vger.kernel.org
Cc: Daan De Meyer <daan.j.demeyer@gmail.com>,
martin.lau@linux.dev, kernel-team@meta.com,
netdev@vger.kernel.org
Subject: [PATCH bpf-next v11 8/9] selftests/bpf: Make sure mount directory exists
Date: Wed, 11 Oct 2023 20:51:10 +0200 [thread overview]
Message-ID: <20231011185113.140426-9-daan.j.demeyer@gmail.com> (raw)
In-Reply-To: <20231011185113.140426-1-daan.j.demeyer@gmail.com>
The mount directory for the selftests cgroup tree might
not exist so let's make sure it does exist by creating
it ourselves if it doesn't exist.
Signed-off-by: Daan De Meyer <daan.j.demeyer@gmail.com>
---
tools/testing/selftests/bpf/cgroup_helpers.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/testing/selftests/bpf/cgroup_helpers.c b/tools/testing/selftests/bpf/cgroup_helpers.c
index 24ba56d42f2d..5b1da2a32ea7 100644
--- a/tools/testing/selftests/bpf/cgroup_helpers.c
+++ b/tools/testing/selftests/bpf/cgroup_helpers.c
@@ -199,6 +199,11 @@ int setup_cgroup_environment(void)
format_cgroup_path(cgroup_workdir, "");
+ if (mkdir(CGROUP_MOUNT_PATH, 0777) && errno != EEXIST) {
+ log_err("mkdir mount");
+ return 1;
+ }
+
if (unshare(CLONE_NEWNS)) {
log_err("unshare");
return 1;
--
2.41.0
next prev parent reply other threads:[~2023-10-11 18:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-11 18:51 [PATCH bpf-next v11 0/9] Add cgroup sockaddr hooks for unix sockets Daan De Meyer
2023-10-11 18:51 ` [PATCH bpf-next v11 1/9] selftests/bpf: Add missing section name tests for getpeername/getsockname Daan De Meyer
2023-10-11 18:51 ` [PATCH bpf-next v11 2/9] bpf: Propagate modified uaddrlen from cgroup sockaddr programs Daan De Meyer
2023-10-11 18:51 ` [PATCH bpf-next v11 3/9] bpf: Add bpf_sock_addr_set_sun_path() to allow writing unix sockaddr from bpf Daan De Meyer
2023-10-11 18:51 ` [PATCH bpf-next v11 4/9] bpf: Implement cgroup sockaddr hooks for unix sockets Daan De Meyer
2023-10-11 18:51 ` [PATCH bpf-next v11 5/9] libbpf: Add support for cgroup unix socket address hooks Daan De Meyer
2023-10-11 18:51 ` [PATCH bpf-next v11 6/9] bpftool: " Daan De Meyer
2023-10-11 18:51 ` [PATCH bpf-next v11 7/9] documentation/bpf: Document " Daan De Meyer
2023-10-11 18:51 ` Daan De Meyer [this message]
2023-10-11 18:51 ` [PATCH bpf-next v11 9/9] selftests/bpf: Add tests for " Daan De Meyer
2023-10-12 0:40 ` [PATCH bpf-next v11 0/9] Add cgroup sockaddr hooks for unix sockets patchwork-bot+netdevbpf
2023-10-12 0:41 ` Martin KaFai Lau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231011185113.140426-9-daan.j.demeyer@gmail.com \
--to=daan.j.demeyer@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=kernel-team@meta.com \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).