From 06bf4334f5d3081e5dee89f75d3cbf76a283a117 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 5 Jan 2018 11:19:15 -0600 Subject: [PATCH] common/config: exclude host, fsid from config reproted to mgr Signed-off-by: Sage Weil --- src/common/config.cc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/common/config.cc b/src/common/config.cc index bfff12dc97dd8..1d8327775b856 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -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; } -- 2.39.5