public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: 202310012359.YEw5IrK6-lkp@intel.com, amir73il@gmail.com,
	calum.mackay@oracle.com, cel@kernel.org, chuck.lever@oracle.com,
	gregkh@linuxfoundation.org, jlayton@kernel.org,
	kernel-team@fb.com, lkp@intel.com, ltp@lists.linux.it,
	pvorel@suse.cz, sherry.yang@oracle.com
Cc: stable-commits@vger.kernel.org
Subject: [LTP] Patch "NFSD: Fix frame size warning in svc_export_parse()" has been added to the 6.1-stable tree
Date: Thu, 15 Aug 2024 10:39:56 +0200	[thread overview]
Message-ID: <2024081556-flock-mooned-892c@gregkh> (raw)
In-Reply-To: <20240810200009.9882-9-cel@kernel.org>


This is a note to let you know that I've just added the patch titled

    NFSD: Fix frame size warning in svc_export_parse()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nfsd-fix-frame-size-warning-in-svc_export_parse.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From stable+bounces-66329-greg=kroah.com@vger.kernel.org Sat Aug 10 22:01:08 2024
From: cel@kernel.org
Date: Sat, 10 Aug 2024 15:59:59 -0400
Subject: NFSD: Fix frame size warning in svc_export_parse()
To: <stable@vger.kernel.org>
Cc: <linux-nfs@vger.kernel.org>, pvorel@suse.cz, sherry.yang@oracle.com, calum.mackay@oracle.com, kernel-team@fb.com, ltp@lists.linux.it, Chuck Lever <chuck.lever@oracle.com>, kernel test robot <lkp@intel.com>, Amir Goldstein <amir73il@gmail.com>, Jeff Layton <jlayton@kernel.org>
Message-ID: <20240810200009.9882-9-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

[ Upstream commit 6939ace1f22681fface7841cdbf34d3204cc94b5 ]

fs/nfsd/export.c: In function 'svc_export_parse':
fs/nfsd/export.c:737:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]
    737 | }

On my systems, svc_export_parse() has a stack frame of over 800
bytes, not 1040, but nonetheless, it could do with some reduction.

When a struct svc_export is on the stack, it's a temporary structure
used as an argument, and not visible as an actual exported FS. No
need to reserve space for export_stats in such cases.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202310012359.YEw5IrK6-lkp@intel.com/
Cc: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Stable-dep-of: 4b14885411f7 ("nfsd: make all of the nfsd stats per-network namespace")
[ cel: adjusted to apply to v6.1.y ]
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/nfsd/export.c |   32 +++++++++++++++++++++++---------
 fs/nfsd/export.h |    4 ++--
 fs/nfsd/stats.h  |   12 ++++++------
 3 files changed, 31 insertions(+), 17 deletions(-)

--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -339,12 +339,16 @@ static int export_stats_init(struct expo
 
 static void export_stats_reset(struct export_stats *stats)
 {
-	nfsd_percpu_counters_reset(stats->counter, EXP_STATS_COUNTERS_NUM);
+	if (stats)
+		nfsd_percpu_counters_reset(stats->counter,
+					   EXP_STATS_COUNTERS_NUM);
 }
 
 static void export_stats_destroy(struct export_stats *stats)
 {
-	nfsd_percpu_counters_destroy(stats->counter, EXP_STATS_COUNTERS_NUM);
+	if (stats)
+		nfsd_percpu_counters_destroy(stats->counter,
+					     EXP_STATS_COUNTERS_NUM);
 }
 
 static void svc_export_put(struct kref *ref)
@@ -353,7 +357,8 @@ static void svc_export_put(struct kref *
 	path_put(&exp->ex_path);
 	auth_domain_put(exp->ex_client);
 	nfsd4_fslocs_free(&exp->ex_fslocs);
-	export_stats_destroy(&exp->ex_stats);
+	export_stats_destroy(exp->ex_stats);
+	kfree(exp->ex_stats);
 	kfree(exp->ex_uuid);
 	kfree_rcu(exp, ex_rcu);
 }
@@ -744,13 +749,15 @@ static int svc_export_show(struct seq_fi
 	seq_putc(m, '\t');
 	seq_escape(m, exp->ex_client->name, " \t\n\\");
 	if (export_stats) {
-		seq_printf(m, "\t%lld\n", exp->ex_stats.start_time);
+		struct percpu_counter *counter = exp->ex_stats->counter;
+
+		seq_printf(m, "\t%lld\n", exp->ex_stats->start_time);
 		seq_printf(m, "\tfh_stale: %lld\n",
-			   percpu_counter_sum_positive(&exp->ex_stats.counter[EXP_STATS_FH_STALE]));
+			   percpu_counter_sum_positive(&counter[EXP_STATS_FH_STALE]));
 		seq_printf(m, "\tio_read: %lld\n",
-			   percpu_counter_sum_positive(&exp->ex_stats.counter[EXP_STATS_IO_READ]));
+			   percpu_counter_sum_positive(&counter[EXP_STATS_IO_READ]));
 		seq_printf(m, "\tio_write: %lld\n",
-			   percpu_counter_sum_positive(&exp->ex_stats.counter[EXP_STATS_IO_WRITE]));
+			   percpu_counter_sum_positive(&counter[EXP_STATS_IO_WRITE]));
 		seq_putc(m, '\n');
 		return 0;
 	}
@@ -796,7 +803,7 @@ static void svc_export_init(struct cache
 	new->ex_layout_types = 0;
 	new->ex_uuid = NULL;
 	new->cd = item->cd;
-	export_stats_reset(&new->ex_stats);
+	export_stats_reset(new->ex_stats);
 }
 
 static void export_update(struct cache_head *cnew, struct cache_head *citem)
@@ -832,7 +839,14 @@ static struct cache_head *svc_export_all
 	if (!i)
 		return NULL;
 
-	if (export_stats_init(&i->ex_stats)) {
+	i->ex_stats = kmalloc(sizeof(*(i->ex_stats)), GFP_KERNEL);
+	if (!i->ex_stats) {
+		kfree(i);
+		return NULL;
+	}
+
+	if (export_stats_init(i->ex_stats)) {
+		kfree(i->ex_stats);
 		kfree(i);
 		return NULL;
 	}
--- a/fs/nfsd/export.h
+++ b/fs/nfsd/export.h
@@ -64,10 +64,10 @@ struct svc_export {
 	struct cache_head	h;
 	struct auth_domain *	ex_client;
 	int			ex_flags;
+	int			ex_fsid;
 	struct path		ex_path;
 	kuid_t			ex_anon_uid;
 	kgid_t			ex_anon_gid;
-	int			ex_fsid;
 	unsigned char *		ex_uuid; /* 16 byte fsid */
 	struct nfsd4_fs_locations ex_fslocs;
 	uint32_t		ex_nflavors;
@@ -76,7 +76,7 @@ struct svc_export {
 	struct nfsd4_deviceid_map *ex_devid_map;
 	struct cache_detail	*cd;
 	struct rcu_head		ex_rcu;
-	struct export_stats	ex_stats;
+	struct export_stats	*ex_stats;
 };
 
 /* an "export key" (expkey) maps a filehandlefragement to an
--- a/fs/nfsd/stats.h
+++ b/fs/nfsd/stats.h
@@ -60,22 +60,22 @@ static inline void nfsd_stats_rc_nocache
 static inline void nfsd_stats_fh_stale_inc(struct svc_export *exp)
 {
 	percpu_counter_inc(&nfsdstats.counter[NFSD_STATS_FH_STALE]);
-	if (exp)
-		percpu_counter_inc(&exp->ex_stats.counter[EXP_STATS_FH_STALE]);
+	if (exp && exp->ex_stats)
+		percpu_counter_inc(&exp->ex_stats->counter[EXP_STATS_FH_STALE]);
 }
 
 static inline void nfsd_stats_io_read_add(struct svc_export *exp, s64 amount)
 {
 	percpu_counter_add(&nfsdstats.counter[NFSD_STATS_IO_READ], amount);
-	if (exp)
-		percpu_counter_add(&exp->ex_stats.counter[EXP_STATS_IO_READ], amount);
+	if (exp && exp->ex_stats)
+		percpu_counter_add(&exp->ex_stats->counter[EXP_STATS_IO_READ], amount);
 }
 
 static inline void nfsd_stats_io_write_add(struct svc_export *exp, s64 amount)
 {
 	percpu_counter_add(&nfsdstats.counter[NFSD_STATS_IO_WRITE], amount);
-	if (exp)
-		percpu_counter_add(&exp->ex_stats.counter[EXP_STATS_IO_WRITE], amount);
+	if (exp && exp->ex_stats)
+		percpu_counter_add(&exp->ex_stats->counter[EXP_STATS_IO_WRITE], amount);
 }
 
 static inline void nfsd_stats_payload_misses_inc(struct nfsd_net *nn)


Patches currently in stable-queue which might be from kroah.com@vger.kernel.org are

queue-6.1/nfsd-remove-nfsd_stats-make-th_cnt-a-global-counter.patch
queue-6.1/nfsd-move-reply-cache-initialization-into-nfsd-startup.patch
queue-6.1/sunrpc-remove-pg_stats-from-svc_program.patch
queue-6.1/mptcp-pm-don-t-try-to-create-sf-if-alloc-failed.patch
queue-6.1/nfsd-rename-nfsd_reply_cache_alloc.patch
queue-6.1/nfsd-make-all-of-the-nfsd-stats-per-network-namespace.patch
queue-6.1/mptcp-pass-addr-to-mptcp_pm_alloc_anno_list.patch
queue-6.1/nfsd-move-init-of-percpu-reply_cache_stats-counters-back-to-nfsd_init_net.patch
queue-6.1/nfsd-replace-nfsd_prune_bucket.patch
queue-6.1/nfsd-stop-setting-pg_stats-for-unused-stats.patch
queue-6.1/sunrpc-don-t-change-sv_stats-if-it-doesn-t-exist.patch
queue-6.1/nfsd-make-svc_stat-per-network-namespace-instead-of-global.patch
queue-6.1/nfsd-fix-frame-size-warning-in-svc_export_parse.patch
queue-6.1/nfsd-rename-nfsd_net_-to-nfsd_stats_.patch
queue-6.1/mptcp-pm-do-not-ignore-subflow-if-signal-flag-is-also-set.patch
queue-6.1/nfsd-refactor-nfsd_reply_cache_free_locked.patch
queue-6.1/mptcp-fully-established-after-add_addr-echo-on-mpj.patch
queue-6.1/sunrpc-use-the-struct-net-as-the-svc-proc-private.patch
queue-6.1/selftests-mptcp-join-test-both-signal-subflow.patch
queue-6.1/sunrpc-pass-in-the-sv_stats-struct-through-svc_create_pooled.patch
queue-6.1/mptcp-pm-reduce-indentation-blocks.patch
queue-6.1/nfsd-rewrite-synopsis-of-nfsd_percpu_counters_init.patch
queue-6.1/nfsd-expose-proc-net-sunrpc-nfsd-in-net-namespaces.patch
queue-6.1/nfsd-refactor-the-duplicate-reply-cache-shrinker.patch

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-08-15  8:40 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-10 19:59 [LTP] [PATCH 6.1.y 00/18] Backport "make svc_stat per-net instead of global" cel
2024-08-10 19:59 ` [LTP] [PATCH 6.1.y 01/18] nfsd: move reply cache initialization into nfsd startup cel
2024-08-15  8:39   ` [LTP] Patch "nfsd: move reply cache initialization into nfsd startup" has been added to the 6.1-stable tree gregkh
2024-08-10 19:59 ` [LTP] [PATCH 6.1.y 02/18] nfsd: move init of percpu reply_cache_stats counters back to nfsd_init_net cel
2024-08-15  8:39   ` [LTP] Patch "nfsd: move init of percpu reply_cache_stats counters back to nfsd_init_net" has been added to the 6.1-stable tree gregkh
2024-08-10 19:59 ` [LTP] [PATCH 6.1.y 03/18] NFSD: Refactor nfsd_reply_cache_free_locked() cel
2024-08-15  8:39   ` [LTP] Patch "NFSD: Refactor nfsd_reply_cache_free_locked()" has been added to the 6.1-stable tree gregkh
2024-08-10 19:59 ` [LTP] [PATCH 6.1.y 04/18] NFSD: Rename nfsd_reply_cache_alloc() cel
2024-08-15  8:39   ` [LTP] Patch "NFSD: Rename nfsd_reply_cache_alloc()" has been added to the 6.1-stable tree gregkh
2024-08-10 19:59 ` [LTP] [PATCH 6.1.y 05/18] NFSD: Replace nfsd_prune_bucket() cel
2024-08-15  8:39   ` [LTP] Patch "NFSD: Replace nfsd_prune_bucket()" has been added to the 6.1-stable tree gregkh
2024-08-10 19:59 ` [LTP] [PATCH 6.1.y 06/18] NFSD: Refactor the duplicate reply cache shrinker cel
2024-08-15  8:39   ` [LTP] Patch "NFSD: Refactor the duplicate reply cache shrinker" has been added to the 6.1-stable tree gregkh
2024-08-10 19:59 ` [LTP] [PATCH 6.1.y 07/18] NFSD: Rewrite synopsis of nfsd_percpu_counters_init() cel
2024-08-15  8:40   ` [LTP] Patch "NFSD: Rewrite synopsis of nfsd_percpu_counters_init()" has been added to the 6.1-stable tree gregkh
2024-08-10 19:59 ` [LTP] [PATCH 6.1.y 08/18] NFSD: Fix frame size warning in svc_export_parse() cel
2024-08-15  8:39   ` gregkh [this message]
2024-08-10 20:00 ` [LTP] [PATCH 6.1.y 09/18] sunrpc: don't change ->sv_stats if it doesn't exist cel
2024-08-15  8:40   ` [LTP] Patch "sunrpc: don't change ->sv_stats if it doesn't exist" has been added to the 6.1-stable tree gregkh
2024-08-10 20:00 ` [LTP] [PATCH 6.1.y 10/18] nfsd: stop setting ->pg_stats for unused stats cel
2024-08-15  8:40   ` [LTP] Patch "nfsd: stop setting ->pg_stats for unused stats" has been added to the 6.1-stable tree gregkh
2024-08-10 20:00 ` [LTP] [PATCH 6.1.y 11/18] sunrpc: pass in the sv_stats struct through svc_create_pooled cel
2024-08-15  8:40   ` [LTP] Patch "sunrpc: pass in the sv_stats struct through svc_create_pooled" has been added to the 6.1-stable tree gregkh
2024-08-10 20:00 ` [LTP] [PATCH 6.1.y 12/18] sunrpc: remove ->pg_stats from svc_program cel
2024-08-15  8:40   ` [LTP] Patch "sunrpc: remove ->pg_stats from svc_program" has been added to the 6.1-stable tree gregkh
2024-08-10 20:00 ` [LTP] [PATCH 6.1.y 13/18] sunrpc: use the struct net as the svc proc private cel
2024-08-15  8:40   ` [LTP] Patch "sunrpc: use the struct net as the svc proc private" has been added to the 6.1-stable tree gregkh
2024-08-10 20:00 ` [LTP] [PATCH 6.1.y 14/18] nfsd: rename NFSD_NET_* to NFSD_STATS_* cel
2024-08-15  8:39   ` [LTP] Patch "nfsd: rename NFSD_NET_* to NFSD_STATS_*" has been added to the 6.1-stable tree gregkh
2024-08-10 20:00 ` [LTP] [PATCH 6.1.y 15/18] nfsd: expose /proc/net/sunrpc/nfsd in net namespaces cel
2024-08-15  8:39   ` [LTP] Patch "nfsd: expose /proc/net/sunrpc/nfsd in net namespaces" has been added to the 6.1-stable tree gregkh
2024-08-10 20:00 ` [LTP] [PATCH 6.1.y 16/18] nfsd: make all of the nfsd stats per-network namespace cel
2024-08-15  8:39   ` [LTP] Patch "nfsd: make all of the nfsd stats per-network namespace" has been added to the 6.1-stable tree gregkh
2024-08-10 20:00 ` [LTP] [PATCH 6.1.y 17/18] nfsd: remove nfsd_stats, make th_cnt a global counter cel
2024-08-15  8:39   ` [LTP] Patch "nfsd: remove nfsd_stats, make th_cnt a global counter" has been added to the 6.1-stable tree gregkh
2024-08-10 20:00 ` [LTP] [PATCH 6.1.y 18/18] nfsd: make svc_stat per-network namespace instead of global cel
2024-08-15  8:39   ` [LTP] Patch "nfsd: make svc_stat per-network namespace instead of global" has been added to the 6.1-stable tree gregkh
2024-08-12 11:34 ` [LTP] [PATCH 6.1.y 00/18] Backport "make svc_stat per-net instead of global" Sasha Levin
2024-08-12 13:52   ` Chuck Lever III via ltp
2024-08-12 14:02     ` Greg KH
2024-08-15  8:27 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2024081556-flock-mooned-892c@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=202310012359.YEw5IrK6-lkp@intel.com \
    --cc=amir73il@gmail.com \
    --cc=calum.mackay@oracle.com \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=kernel-team@fb.com \
    --cc=lkp@intel.com \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    --cc=sherry.yang@oracle.com \
    --cc=stable-commits@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox