From a895982066b9e2c1045f6bbf38fed14e34512641 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 29 Aug 2015 00:08:10 +0800 Subject: [PATCH] common: 'enable experimental data corrupting features' now understands '*' '*' allows any feature. Signed-off-by: Kefu Chai --- src/common/ceph_context.cc | 3 ++- src/test/common/test_context.cc | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index 877dd539284c..ff7bf2bf0e6b 100644 --- a/src/common/ceph_context.cc +++ b/src/common/ceph_context.cc @@ -230,7 +230,8 @@ bool CephContext::check_experimental_feature_enabled(const std::string& feat, std::ostream *message) { ceph_spin_lock(&_feature_lock); - bool enabled = _experimental_features.count(feat); + bool enabled = (_experimental_features.count(feat) || + _experimental_features.count("*")); ceph_spin_unlock(&_feature_lock); if (enabled) { diff --git a/src/test/common/test_context.cc b/src/test/common/test_context.cc index c32fed30b322..921fc90ff5fa 100644 --- a/src/test/common/test_context.cc +++ b/src/test/common/test_context.cc @@ -82,6 +82,13 @@ TEST(CephContext, experimental_features) ASSERT_FALSE(cct->check_experimental_feature_enabled("bar")); ASSERT_TRUE(cct->check_experimental_feature_enabled("baz")); + cct->_conf->set_val("enable_experimental_unrecoverable_data_corrupting_features", + "*"); + cct->_conf->apply_changes(&cout); + ASSERT_TRUE(cct->check_experimental_feature_enabled("foo")); + ASSERT_TRUE(cct->check_experimental_feature_enabled("bar")); + ASSERT_TRUE(cct->check_experimental_feature_enabled("baz")); + cct->_log->flush(); } -- 2.47.3