From c1cd8442174afafbbd61799203145eae80b2163c Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Fri, 17 Jul 2026 07:08:54 -0400 Subject: [PATCH] sunrpc: use per-net counts in svc_seq_show() Update svc_seq_show() to read from the per-netns statp->vs_count[] arrays instead of the global svc_version->vs_count[]. The only caller is nfsd, which always allocates vs_count via svc_stat_alloc_counts() in nfsd_net_init(), so the per-netns arrays are always available. This makes /proc/net/rpc/nfsd report per-network-namespace procedure call counts. Assisted-by: LLM Signed-off-by: Jeff Layton Link: https://patch.msgid.link/20260717-exportd-netlink-v7-2-b7ce17b83b60@kernel.org Signed-off-by: Chuck Lever --- net/sunrpc/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index 7093e18ac26c..d08711bee18e 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c @@ -108,7 +108,7 @@ void svc_seq_show(struct seq_file *seq, const struct svc_stat *statp) for (j = 0; j < vers->vs_nproc; j++) { count = 0; for_each_possible_cpu(k) - count += per_cpu(vers->vs_count[j], k); + count += per_cpu(statp->vs_count[i][j], k); seq_printf(seq, " %lu", count); } seq_putc(seq, '\n');