]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/config: exclude host, fsid from config reproted to mgr
authorSage Weil <sage@redhat.com>
Fri, 5 Jan 2018 17:19:15 +0000 (11:19 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:48 +0000 (14:44 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config.cc

index bfff12dc97dd8b05b999b85ca3290a138ef666ae..1d8327775b856fb00e689785770bf8aca8471e1d 100644 (file)
@@ -889,15 +889,23 @@ void md_config_t::get_config_bl(bufferlist *bl)
 {
   Mutex::Locker l(lock);
   if (values_bl.length() == 0) {
-    ::encode((uint32_t)values.size(), values_bl);
+    uint32_t n = 0;
+    bufferlist bl;
     for (auto& i : values) {
-      ::encode(i.first, values_bl);
-      ::encode((uint32_t)i.second.size(), values_bl);
+      if (i.first == "fsid" ||
+         i.first == "host") {
+       continue;
+      }
+      ++n;
+      ::encode(i.first, bl);
+      ::encode((uint32_t)i.second.size(), bl);
       for (auto& j : i.second) {
-       ::encode(j.first, values_bl);
-       ::encode(stringify(j.second), values_bl);
+       ::encode(j.first, bl);
+       ::encode(stringify(j.second), bl);
       }
     }
+    ::encode(n, values_bl);
+    values_bl.claim_append(bl);
   }
   *bl = values_bl;
 }