From 645e89d94004f5c77275be7f7cdd1e5a3d868cdb Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Sat, 6 Mar 2021 11:15:40 +0100 Subject: [PATCH] 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) --- src/mon/MonClient.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 982a79887b91c..7e60ce973b5c3 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -910,7 +910,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; -- 2.39.5