mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tejun Heo <tj@kernel.org>
Cc: "Johannes Weiner" <hannes@cmpxchg.org>,
	"Michal Koutný" <mkoutny@suse.com>,
	"Serge Hallyn" <serge.hallyn@ubuntu.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Juri Lelli" <juri.lelli@redhat.com>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	"Dietmar Eggemann" <dietmar.eggemann@arm.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Ben Segall" <bsegall@google.com>, "Mel Gorman" <mgorman@suse.de>,
	"Valentin Schneider" <vschneid@redhat.com>,
	"K Prateek Nayak" <kprateek.nayak@amd.com>,
	"Yonghong Song" <yonghong.song@linux.dev>,
	"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>,
	driver-core@lists.linux.dev, cgroups@vger.kernel.org,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com
Subject: [PATCH v2 3/3] bpf: Describe cgroup_iter's fdinfo path for paths which don't fit
Date: Sat, 28 Nov 2026 21:38:27 -0800	[thread overview]
Message-ID: <6058cc3be190392debbc8402ea8479528eb75599.1795930577.git.chris@chrisdown.name> (raw)
In-Reply-To: <cover.1795930577.git.chris@chrisdown.name>

bpf_iter_cgroup_show_fdinfo() says that if cgroup_path_ns() fails, buf
is an empty string and nothing is printed. That isn't the case for a
path which doesn't fit in PATH_MAX: cgroup_path_ns() now returns -E2BIG
with the end of the path in buf, and fdinfo prints that.

The end of the path is still useful to show, so let's update the comment
to say so rather than change what is printed.

Signed-off-by: Chris Down <chris@chrisdown.name>
---
 kernel/bpf/cgroup_iter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/bpf/cgroup_iter.c b/kernel/bpf/cgroup_iter.c
index fd51fe3d92cc..12e702e421aa 100644
--- a/kernel/bpf/cgroup_iter.c
+++ b/kernel/bpf/cgroup_iter.c
@@ -251,7 +251,8 @@ static void bpf_iter_cgroup_show_fdinfo(const struct bpf_iter_aux_info *aux,
 	}
 
 	/* If cgroup_path_ns() fails, buf will be an empty string, cgroup_path
-	 * will print nothing.
+	 * will print nothing. The exception is a path which doesn't fit, where
+	 * buf holds as much of the end of the path as fits.
 	 *
 	 * Path is in the calling process's cgroup namespace.
 	 */
-- 
2.56.1


  parent reply	other threads:[~2026-11-29  5:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  5:38 [PATCH v2 0/3] kernfs: Build paths in linear time with respect to depth Chris Down
2026-11-29  5:38 ` [PATCH v2 1/3] " Chris Down
2026-11-29  5:38 ` [PATCH v2 2/3] sched/debug: Mark a truncated group path at the start Chris Down
2026-11-29  5:38 ` Chris Down [this message]
2026-11-29 16:36 ` [PATCH v2 0/3] kernfs: Build paths in linear time with respect to depth Tejun Heo

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=6058cc3be190392debbc8402ea8479528eb75599.1795930577.git.chris@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=bsegall@google.com \
    --cc=cgroups@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dietmar.eggemann@arm.com \
    --cc=driver-core@lists.linux.dev \
    --cc=eddyz87@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=juri.lelli@redhat.com \
    --cc=kernel-team@meta.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=memxor@gmail.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=mkoutny@suse.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=serge.hallyn@ubuntu.com \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.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®