[PATCH 3/3] ceph: add force_ignore_metric_bits module parameter support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Xiubo Li <xiubli@xxxxxxxxxx>

This parameter will force ignoring the metric bits from the MDS,
and will force sending all the metrics kernel supports. It's
dangerous for some old ceph clusters which will crash the MDSes
when receive unknown metrics.

URL: https://tracker.ceph.com/issues/54411
Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx>
---
 fs/ceph/metric.c | 1 +
 fs/ceph/metric.h | 1 +
 fs/ceph/super.c  | 6 +++++-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/fs/ceph/metric.c b/fs/ceph/metric.c
index f01c1f4e6b89..bfb5e255e3d2 100644
--- a/fs/ceph/metric.c
+++ b/fs/ceph/metric.c
@@ -51,6 +51,7 @@ static bool ceph_mdsc_send_metrics(struct ceph_mds_client *mdsc,
 
 	head = msg->front.iov_base;
 
+	force = force || force_ignore_metric_bits;
 	/* encode the cap metric */
 	if (force || test_bit(CLIENT_METRIC_TYPE_CAP_INFO, &s->s_metrics)) {
 		cap = (struct ceph_metric_cap *)(head + 1);
diff --git a/fs/ceph/metric.h b/fs/ceph/metric.h
index 0d0c44bd3332..b0018887b078 100644
--- a/fs/ceph/metric.h
+++ b/fs/ceph/metric.h
@@ -7,6 +7,7 @@
 #include <linux/ktime.h>
 
 extern bool disable_send_metrics;
+extern bool force_ignore_metric_bits;
 
 enum ceph_metric_type {
 	CLIENT_METRIC_TYPE_CAP_INFO,
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index a859921bbe96..292222b7b733 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -1485,7 +1485,11 @@ static const struct kernel_param_ops param_ops_metrics = {
 
 bool disable_send_metrics = false;
 module_param_cb(disable_send_metrics, &param_ops_metrics, &disable_send_metrics, 0644);
-MODULE_PARM_DESC(disable_send_metrics, "Enable sending perf metrics to ceph cluster (default: on)");
+MODULE_PARM_DESC(disable_send_metrics, "Disable sending perf metrics to ceph cluster (default: off)");
+
+bool force_ignore_metric_bits = false;
+module_param_cb(force_ignore_metric_bits, &param_ops_bool, &force_ignore_metric_bits, 0644);
+MODULE_PARM_DESC(disable_send_metrics, "Force ignoring session's metric bits from MDS (default: off)");
 
 /* for both v1 and v2 syntax */
 static bool mount_support = true;
-- 
2.27.0




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux