]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/config.cc
import 15.2.9
[ceph.git] / ceph / src / common / config.cc
index dd4958d401cba16691da81a8986fef02c9059652..53007f925146d65489b0840b6905f528266312aa 100644 (file)
@@ -1107,17 +1107,19 @@ void md_config_t::early_expand_meta(
 bool md_config_t::finalize_reexpand_meta(ConfigValues& values,
                                         const ConfigTracker& tracker)
 {
-  for (auto& [name, value] : may_reexpand_meta) {
-    set_val(values, tracker, name, value);
-  }
-  
-  if (!may_reexpand_meta.empty()) {
-    // meta expands could have modified anything.  Copy it all out again.
-    update_legacy_vals(values);
-    return true;
-  } else {
-    return false;
+  std::vector<std::string> reexpands;
+  reexpands.swap(may_reexpand_meta);
+  for (auto& name : reexpands) {
+    // always refresh the options if they are in the may_reexpand_meta
+    // map, because the options may have already been expanded with old
+    // meta.
+    const auto &opt_iter = schema.find(name);
+    ceph_assert(opt_iter != schema.end());
+    const Option &opt = opt_iter->second;
+    _refresh(values, opt);
   }
+
+  return !may_reexpand_meta.empty();
 }
 
 Option::value_t md_config_t::_expand_meta(
@@ -1201,7 +1203,7 @@ Option::value_t md_config_t::_expand_meta(
       } else if (var == "pid") {
        out += stringify(getpid());
         if (o) {
-          may_reexpand_meta[o->name] = *str;
+          may_reexpand_meta.push_back(o->name);
         }
       } else if (var == "cctid") {
        out += stringify((unsigned long long)this);