netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ss: Tone down cgroup path resolution
@ 2025-02-10 14:11 Michal Koutný
  2025-02-18 13:11 ` Davide Benini
  2025-02-20 22:20 ` Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: Michal Koutný @ 2025-02-10 14:11 UTC (permalink / raw)
  To: netdev; +Cc: mkoutny, mkubecek

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.
Improve user experience by silencing these specific errors.
---
 lib/fs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/fs.c b/lib/fs.c
index 622f28b3..6fe1d6db 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.48.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-21  9:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10 14:11 [PATCH] ss: Tone down cgroup path resolution Michal Koutný
2025-02-18 13:11 ` Davide Benini
2025-02-18 13:40   ` Michal Koutný
2025-02-20 22:20 ` Stephen Hemminger
2025-02-21  9:32   ` Michal Koutný

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).