diff mbox series

ceph: disable sending metrics thoroughly when it's disabled

Message ID 20230720033800.110717-1-xiubli@redhat.com (mailing list archive)
State New, archived
Headers show
Series ceph: disable sending metrics thoroughly when it's disabled | expand

Commit Message

Xiubo Li July 20, 2023, 3:38 a.m. UTC
From: Xiubo Li <xiubli@redhat.com>

Even the 'disable_send_metrics' is true so when the session is
being opened it will always trigger to send the metric for the
first time.

Cc: stable@vger.kernel.org
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 fs/ceph/metric.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Venky Shankar July 20, 2023, 3:46 a.m. UTC | #1
On Thu, Jul 20, 2023 at 9:09 AM <xiubli@redhat.com> wrote:
>
> From: Xiubo Li <xiubli@redhat.com>
>
> Even the 'disable_send_metrics' is true so when the session is
> being opened it will always trigger to send the metric for the
> first time.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  fs/ceph/metric.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ceph/metric.c b/fs/ceph/metric.c
> index cce78d769f55..6d3584f16f9a 100644
> --- a/fs/ceph/metric.c
> +++ b/fs/ceph/metric.c
> @@ -216,7 +216,7 @@ static void metric_delayed_work(struct work_struct *work)
>         struct ceph_mds_client *mdsc =
>                 container_of(m, struct ceph_mds_client, metric);
>
> -       if (mdsc->stopping)
> +       if (mdsc->stopping || disable_send_metrics)
>                 return;
>
>         if (!m->session || !check_session_state(m->session)) {
> --
> 2.40.1
>

LGTM.

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Jeff Layton July 20, 2023, 10:25 a.m. UTC | #2
On Thu, 2023-07-20 at 11:38 +0800, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
> 
> Even the 'disable_send_metrics' is true so when the session is
> being opened it will always trigger to send the metric for the
> first time.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  fs/ceph/metric.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/metric.c b/fs/ceph/metric.c
> index cce78d769f55..6d3584f16f9a 100644
> --- a/fs/ceph/metric.c
> +++ b/fs/ceph/metric.c
> @@ -216,7 +216,7 @@ static void metric_delayed_work(struct work_struct *work)
>  	struct ceph_mds_client *mdsc =
>  		container_of(m, struct ceph_mds_client, metric);
>  
> -	if (mdsc->stopping)
> +	if (mdsc->stopping || disable_send_metrics)
>  		return;
>  
>  	if (!m->session || !check_session_state(m->session)) {

Reviewed-by: Jeff Layton <jlayton@kernel.org>
diff mbox series

Patch

diff --git a/fs/ceph/metric.c b/fs/ceph/metric.c
index cce78d769f55..6d3584f16f9a 100644
--- a/fs/ceph/metric.c
+++ b/fs/ceph/metric.c
@@ -216,7 +216,7 @@  static void metric_delayed_work(struct work_struct *work)
 	struct ceph_mds_client *mdsc =
 		container_of(m, struct ceph_mds_client, metric);
 
-	if (mdsc->stopping)
+	if (mdsc->stopping || disable_send_metrics)
 		return;
 
 	if (!m->session || !check_session_state(m->session)) {