From: Chuck Lever <chuck.lever@xxxxxxxxxx> [ Upstream commit 5ec39944f874e1ecc09f624a70dfaa8ac3bf9d08 ] In function â??export_stats_initâ??, inlined from â??svc_export_allocâ?? at fs/nfsd/export.c:866:6: fs/nfsd/export.c:337:16: warning: â??nfsd_percpu_counters_initâ?? accessing 40 bytes in a region of size 0 [-Wstringop-overflow=] 337 | return nfsd_percpu_counters_init(&stats->counter, EXP_STATS_COUNTERS_NUM); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/nfsd/export.c:337:16: note: referencing argument 1 of type â??struct percpu_counter[0]â?? fs/nfsd/stats.h: In function â??svc_export_allocâ??: fs/nfsd/stats.h:40:5: note: in a call to function â??nfsd_percpu_counters_initâ?? 40 | int nfsd_percpu_counters_init(struct percpu_counter counters[], int num); | ^~~~~~~~~~~~~~~~~~~~~~~~~ Cc: Amir Goldstein <amir73il@xxxxxxxxx> Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxx> Stable-dep-of: 93483ac5fec6 ("nfsd: expose /proc/net/sunrpc/nfsd in net namespaces") Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/nfsd/stats.c | 2 +- fs/nfsd/stats.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/fs/nfsd/stats.c +++ b/fs/nfsd/stats.c @@ -74,7 +74,7 @@ static int nfsd_show(struct seq_file *se DEFINE_PROC_SHOW_ATTRIBUTE(nfsd); -int nfsd_percpu_counters_init(struct percpu_counter counters[], int num) +int nfsd_percpu_counters_init(struct percpu_counter *counters, int num) { int i, err = 0; --- a/fs/nfsd/stats.h +++ b/fs/nfsd/stats.h @@ -36,9 +36,9 @@ extern struct nfsd_stats nfsdstats; extern struct svc_stat nfsd_svcstats; -int nfsd_percpu_counters_init(struct percpu_counter counters[], int num); -void nfsd_percpu_counters_reset(struct percpu_counter counters[], int num); -void nfsd_percpu_counters_destroy(struct percpu_counter counters[], int num); +int nfsd_percpu_counters_init(struct percpu_counter *counters, int num); +void nfsd_percpu_counters_reset(struct percpu_counter *counters, int num); +void nfsd_percpu_counters_destroy(struct percpu_counter *counters, int num); int nfsd_stat_init(void); void nfsd_stat_shutdown(void); Patches currently in stable-queue which might be from cel@xxxxxxxxxx are queue-5.15/nfsd-rename-nfsd_net_-to-nfsd_stats_.patch queue-5.15/nfsd-rename-nfsd_reply_cache_alloc.patch queue-5.15/sunrpc-pass-in-the-sv_stats-struct-through-svc_create_pooled.patch queue-5.15/nfsd-move-init-of-percpu-reply_cache_stats-counters-back-to-nfsd_init_net.patch queue-5.15/sunrpc-use-the-struct-net-as-the-svc-proc-private.patch queue-5.15/nfsd-rewrite-synopsis-of-nfsd_percpu_counters_init.patch queue-5.15/nfsd-replace-nfsd_prune_bucket.patch queue-5.15/nfsd-refactor-the-duplicate-reply-cache-shrinker.patch queue-5.15/sunrpc-remove-pg_stats-from-svc_program.patch queue-5.15/nfsd-make-all-of-the-nfsd-stats-per-network-namespace.patch queue-5.15/nfsd-fix-frame-size-warning-in-svc_export_parse.patch queue-5.15/nfsd-expose-proc-net-sunrpc-nfsd-in-net-namespaces.patch queue-5.15/nfsd-move-reply-cache-initialization-into-nfsd-startup.patch queue-5.15/nfsd-remove-nfsd_stats-make-th_cnt-a-global-counter.patch queue-5.15/nfsd-make-svc_stat-per-network-namespace-instead-of-global.patch queue-5.15/sunrpc-don-t-change-sv_stats-if-it-doesn-t-exist.patch queue-5.15/nfsd-refactor-nfsd_reply_cache_free_locked.patch queue-5.15/nfsd-stop-setting-pg_stats-for-unused-stats.patch