From 99c119a0de0d76effe6926ce213d041cea54aa7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Koutn=C3=BD?= Date: Fri, 21 Feb 2025 10:29:26 +0100 Subject: [PATCH] ss: Tone down cgroup path resolution MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sockets and cgroups have different lifetimes (e.g. fd passing between cgroups) so obtaining a cgroup id to a removed cgroup dir is not an error. Furthermore, the message is printed for each such a socket (which is redundant each such socket's cgroup is shown as 'unreachable'). Improve user experience by silencing these specific errors. Signed-off-by: Michal Koutný --- lib/fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/fs.c b/lib/fs.c index 622f28b35..6fe1d6db4 100644 --- a/lib/fs.c +++ b/lib/fs.c @@ -223,7 +223,8 @@ char *get_cgroup2_path(__u64 id, bool full) fd = open_by_handle_at(mnt_fd, fhp, 0); if (fd < 0) { - fprintf(stderr, "Failed to open cgroup2 by ID\n"); + if (errno != ESTALE) + fprintf(stderr, "Failed to open cgroup2 by ID\n"); goto out; } -- 2.47.2