From: Ilya Dryomov Date: Sat, 6 Mar 2021 10:15:40 +0000 (+0100) Subject: mon/MonClient: claim active_con's auth explicitly X-Git-Tag: v14.2.20~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8ec7828e07c63d3c6cd4470c25ba2e56d54e0636;p=ceph.git mon/MonClient: claim active_con's auth explicitly Eliminate confusion by moving auth from active_con into MonClient instead of swapping them. The existing MonClient::auth can be destroyed right away -- I don't see why active_con would need it or a reason to delay its destruction (which is what stashing in active_con effectively does). Signed-off-by: Ilya Dryomov (cherry picked from commit eec24e4d119c57c7eb5119dc0083616a61b33b89) --- diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 8a9fc8c2dee9..96bd816f7dce 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -797,7 +797,7 @@ void MonClient::_finish_hunting(int auth_err) _resend_mon_commands(); send_log(true); if (active_con) { - std::swap(auth, active_con->get_auth()); + auth = std::move(active_con->get_auth()); if (global_id && global_id != active_con->get_global_id()) { lderr(cct) << __func__ << " global_id changed from " << global_id << " to " << active_con->get_global_id() << dendl;