]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: use OSDMap::get_pg_acting_primary() to get the primary
authorKefu Chai <kchai@redhat.com>
Fri, 31 Mar 2017 10:30:53 +0000 (18:30 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 31 Mar 2017 10:31:05 +0000 (18:31 +0800)
OSDMap::pg_to_acting_osds() assumes that the "acting" parameter is not
null.

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

index 5237f93a5ed7d2012acd62f14ef0f2cea28ccfb6..f4f301193ae6e108bfbe33180b5f8c927a213c63 100644 (file)
@@ -498,7 +498,7 @@ bool DaemonServer::handle_command(MCommand *m)
     int acting_primary = -1;
     entity_inst_t inst;
     cluster_state.with_osdmap([&](const OSDMap& osdmap) {
-       osdmap.pg_to_acting_osds(pgid, nullptr, &acting_primary);
+       acting_primary = osdmap.get_pg_acting_primary(pgid);
        if (acting_primary >= 0) {
          inst = osdmap.get_inst(acting_primary);
        }