]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/OSDMap: Replace get_out_osds with get_out_existing_osds
authorBrad Hubbard <bhubbard@redhat.com>
Wed, 17 Apr 2019 06:13:27 +0000 (16:13 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Thu, 18 Apr 2019 02:02:48 +0000 (22:02 -0400)
Fixes: http://tracker.ceph.com/issues/39154
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/mon/OSDMonitor.cc
src/osd/OSDMap.cc
src/osd/OSDMap.h

index ecbb5cd27113bb62b596d2fdf403613d474eadde..5d0d945f8d1f60cc295806abc9692b8c72ecc387 100644 (file)
@@ -10446,7 +10446,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
           (idvec[0] == "any" || idvec[0] == "all" || idvec[0] == "*")) {
         if (prefix == "osd in") {
           // touch out osds only
-          osdmap.get_out_osds(osds);
+          osdmap.get_out_existing_osds(osds);
         } else {
           osdmap.get_all_osds(osds);
         }
index efb2b9b6d592cfd159264819e7b04dbe2606824b..8cf8a9821ef20399894aa2df212c1d7c0a315a39 100644 (file)
@@ -1408,10 +1408,10 @@ void OSDMap::get_up_osds(set<int32_t>& ls) const
   }
 }
 
-void OSDMap::get_out_osds(set<int32_t>& ls) const
+void OSDMap::get_out_existing_osds(set<int32_t>& ls) const
 {
   for (int i = 0; i < max_osd; i++) {
-    if (is_out(i))
+    if (exists(i) && get_weight(i) == CEPH_OSD_OUT)
       ls.insert(i);
   }
 }
index 46081422e9badf183a4e8bb21063c7d90e942383..50089cee46f3e06d6cb6375327c7f86d58e96532 100644 (file)
@@ -713,7 +713,7 @@ public:
 
   void get_all_osds(std::set<int32_t>& ls) const;
   void get_up_osds(std::set<int32_t>& ls) const;
-  void get_out_osds(std::set<int32_t>& ls) const;
+  void get_out_existing_osds(std::set<int32_t>& ls) const;
   unsigned get_num_pg_temp() const {
     return pg_temp->size();
   }