From patchwork Mon Nov 18 21:20:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13879092 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDCDD188CDC; Mon, 18 Nov 2024 21:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731964847; cv=none; b=p5PvUZhRcgJfKtSh1lsVNmi5n0JYYLfERr6RTXNOH3ia97SkA7tJSla09t4dX06vpdigIsQgeNoF1NhpOoPA+17fMvfQiHV1Amf/rGM7DWTKoyjpu2c6voYHUKUdceELcdCw69wZ7li+6qpLLZhcCh0/SfI7j23NKOfFGciq+cY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731964847; c=relaxed/simple; bh=q1av7ZgzVCp3O0yobASQGrY6JXc5HC4GpaDkoRz9n1s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XLRfSS3iL/mXcDC97G1pC2718ykmPGW1eathFhAFpvn3pGYXxCruKEBtty4Sr5DUrmRvYH1c0Hm96jFt7KWmNYnMSfkgb6CHwO5nbDY/50KkU0W26WTzfuf9ofZ1PFXd90WyRiQsJ1j8pNpythe8pdPC0dMD5tS20DMZammuEAs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KYEY4bu0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KYEY4bu0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 520BBC4CED7; Mon, 18 Nov 2024 21:20:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731964846; bh=q1av7ZgzVCp3O0yobASQGrY6JXc5HC4GpaDkoRz9n1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KYEY4bu0K0w3JVECcvtIBJdzwcJ3uSlFsfkr7fFeDgFX9jSU/gleGpPSLWrIhyCyr ucFx2IwcvIc0IBYVQT4KQMOu1EkxLdMUotS1o0vbaWkNvdSA6Cpz06nXrCsOirdCtD Cid9owNduE7YliQ30ik0MIH1WqG++70oKC7+bHHECA0zDzaVJJdbolpXDldgZIFKnz n0emtOYz4MoS9XJzGqIKZII1FP7788Y4Nl29i0UIQeaF2kLNL4TxTeOIEELyXCxbEj 5WTwKCpZOQ4ZPhsSdqeWsL6Idzc7ACovjQSNTEUvMIiRap4HMX1Gpjl7mLPUjRN91V 7xSH8hVr5bUlQ== From: cel@kernel.org To: Cc: , Jeff Layton , Chuck Lever , Amir Goldstein Subject: [PATCH 5.15.y 07/18] NFSD: Rewrite synopsis of nfsd_percpu_counters_init() Date: Mon, 18 Nov 2024 16:20:24 -0500 Message-ID: <20241118212035.3848-13-cel@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241118212035.3848-1-cel@kernel.org> References: <20241118212035.3848-1-cel@kernel.org> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever [ 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 Reviewed-by: Jeff Layton Stable-dep-of: 93483ac5fec6 ("nfsd: expose /proc/net/sunrpc/nfsd in net namespaces") Signed-off-by: Chuck Lever --- fs/nfsd/stats.c | 2 +- fs/nfsd/stats.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/nfsd/stats.c b/fs/nfsd/stats.c index 777e24e5da33..1fe6488a1cf9 100644 --- a/fs/nfsd/stats.c +++ b/fs/nfsd/stats.c @@ -74,7 +74,7 @@ static int nfsd_show(struct seq_file *seq, void *v) 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; diff --git a/fs/nfsd/stats.h b/fs/nfsd/stats.h index 9b43dc3d9991..c3abe1830da5 100644 --- 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);