]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/OSDMonitor: check get()'s return value instead of bl's length
authorKefu Chai <kchai@redhat.com>
Wed, 26 Apr 2017 12:17:42 +0000 (20:17 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 26 Apr 2017 12:17:47 +0000 (20:17 +0800)
instead of assuming how the bl is encoded, we'd better rely on the
return code of get().

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/OSDMonitor.cc

index e740677f4add4d747e095e3b0983a096fc4de989..b1b603319857e907fd36ed001862c63d92e4e709 100644 (file)
@@ -303,8 +303,7 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
   if (mon->monmap->get_required_features().contains_all(
        ceph::features::mon::FEATURE_LUMINOUS)) {
     bufferlist bl;
-    mon->store->get(OSD_PG_CREATING_PREFIX, "creating", bl);
-    if (bl.length()) {
+    if (!mon->store->get(OSD_PG_CREATING_PREFIX, "creating", bl)) {
       auto p = bl.begin();
       std::lock_guard<std::mutex> l(creating_pgs_lock);
       creating_pgs.decode(p);