]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: Replace get_out_osds with get_out_existing_osds 27728/head
authorBrad Hubbard <bhubbard@redhat.com>
Wed, 17 Apr 2019 06:13:27 +0000 (16:13 +1000)
committerNeha Ojha <nojha@redhat.com>
Tue, 23 Apr 2019 17:43:04 +0000 (13:43 -0400)
Fixes: http://tracker.ceph.com/issues/39154
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit adfb6a595363e2c085c6eac3001fcaa2dce007aa)

 Conflicts:
src/osd/OSDMap.h - Trivial resolution - no std::

src/mon/OSDMonitor.cc
src/osd/OSDMap.cc
src/osd/OSDMap.h

index 9ce27c1362932f3c7b58d11c16e720b9feae7511..f9a50f31c446c346e2f7f6c1bc078702c64ac48d 100644 (file)
@@ -9553,7 +9553,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 33c353d46a531accfaa20ba12c2ce1478243cfb2..91d22e2647a315a6a346169cdc88d3108f4a0605 100644 (file)
@@ -1255,10 +1255,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 bea0000efd0d0e3373f3690c72851691c028c1e8..181cceb4291754de2cea50a1035ac60d9e84110d 100644 (file)
@@ -694,7 +694,7 @@ public:
 
   void get_all_osds(set<int32_t>& ls) const;
   void get_up_osds(set<int32_t>& ls) const;
-  void get_out_osds(set<int32_t>& ls) const;
+  void get_out_existing_osds(set<int32_t>& ls) const;
   unsigned get_num_pg_temp() const {
     return pg_temp->size();
   }