From: Quentin Monnet <qmo@kernel.org>
To: thamrinjonathan@gmail.com, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Jiri Olsa <jolsa@kernel.org>,
Emil Tsalapatis <emil@etsalapatis.com>,
Ihor Solodrai <ihor.solodrai@linux.dev>,
Roman Gushchin <roman.gushchin@linux.dev>,
Jakub Kicinski <kuba@kernel.org>
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next] bpftool: Skip cgroups removed during cgroup tree walk
Date: Wed, 11 Nov 2026 15:03:04 +0000 [thread overview]
Message-ID: <8963886e-f000-4d25-a5a9-04ad0163e7ac@kernel.org> (raw)
In-Reply-To: <20261111-bpftool-cgroup-tree-enoent-v1-1-f3bfcddb4f3d@gmail.com>
2026-11-11 12:17 UTC+0700 ~ Jonathan Bastari Thamrin via B4 Relay
<devnull+thamrinjonathan.gmail.com@kernel.org>
> From: Jonathan Bastari Thamrin <thamrinjonathan@gmail.com>
>
> When a cgroup is removed after being found by nftw(), open() or
> cgroup_has_attached_progs() in do_show_tree_fn() returns ENOENT.
> This is treated as a fatal error so the walk stops and the rest of
> the tree isn't listed. This is common on systemd hosts as
> transient scopes are created and removed all the time.
>
> With "systemd-run --user --scope true" running in a loop, the walk
> fails within a few hundred runs:
>
> Error: can't query bpf programs attached to /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/app.slice/run-p126141-i75408.scope: No such file or directory
>
> Treat ENOENT as the cgroup being gone and continue the walk. With
> this patch, 2000 runs in a row complete without error.
>
> Link: https://github.com/libbpf/bpftool/issues/159
> Fixes: 2058b38371d0 ("bpftool: introduce cgroup tree command")
> Signed-off-by: Jonathan Bastari Thamrin <thamrinjonathan@gmail.com>
> ---
> The ENODEV originally reported in #159 was fixed by 98b303c9bf05
> ("bpftool: Query only cgroup-related attach types"). This fixes the
> ENOENT race that still breaks cgroup tree on bpftool v7.6.0.
Looks good to me, thank you for the fix.
Acked-by: Quentin Monnet <qmo@kernel.org>
prev parent reply other threads:[~2026-11-11 15:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 5:17 Jonathan Bastari Thamrin via B4 Relay
2026-11-11 15:03 ` Quentin Monnet [this message]
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=8963886e-f000-4d25-a5a9-04ad0163e7ac@kernel.org \
--to=qmo@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=roman.gushchin@linux.dev \
--cc=song@kernel.org \
--cc=thamrinjonathan@gmail.com \
--cc=yonghong.song@linux.dev \
/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
all inboxes | Powered by JetHome®