Re: [PATCH v4 1/4] sunrpc: add per-netns per-procedure call counts to svc_stat

Jeff Layton <[email protected]>
Newsgroups gmane.linux.nfs,gmane.linux.kernel
Message-ID <[email protected]>
On Tue, 2026-06-16 at 19:55 -0400, Chuck Lever wrote:
> Hey Jeff -
> 
> On Tue, Jun 16, 2026, at 8:45 AM, Jeff Layton wrote:
> > The existing per-procedure call counts live in global
> > svc_version->vs_count[] arrays which are not network-namespace-aware.
> > Add per-netns equivalents in struct svc_stat so the upcoming netlink
> > stats interface can return namespace-scoped statistics.
> > 
> > Add a vs_count pointer array to struct svc_stat, along with
> > svc_stat_alloc_counts() and svc_stat_free_counts() helpers to manage
> > per-version percpu call count arrays.
> 
> This patch appears to break the build for an NFSv3-only server
> configured with CONFIG_PROC_FS=n.
> 
> svc_stat_alloc_counts() and svc_stat_free_counts() are defined in
> net/sunrpc/stats.c, which the Makefile builds only under PROC_FS:
> 
>        sunrpc-$(CONFIG_PROC_FS) += stats.o
> 
> nfsd_net_init()/nfsd_net_exit() call both helpers unconditionally,
> and the declarations in <linux/sunrpc/stats.h> sit outside the
> #ifdef CONFIG_PROC_FS block with no !PROC_FS stubs. CONFIG_NFSD does
> not depend on PROC_FS -- only NFSD_V4 does -- so NFSD=y with
> NFSD_V2/V3 and PROC_FS=n is a valid Kconfig combination. The result
> is an undefined reference to svc_stat_alloc_counts at vmlinux link
> (NFSD=y), or a modpost failure for NFSD=m since both symbols are
> EXPORT_SYMBOL_GPL.
> 
> net/sunrpc/svc.c is always built, and might be a more natural home
> for the new functions.

Thanks. Looks pretty simple to fix. I'll plan to send a v5.
-- 
Jeff Layton <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.