]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonClient: claim active_con's auth explicitly
authorIlya Dryomov <idryomov@gmail.com>
Sat, 6 Mar 2021 10:15:40 +0000 (11:15 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 12 Apr 2021 18:50:53 +0000 (20:50 +0200)
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 <idryomov@gmail.com>
(cherry picked from commit eec24e4d119c57c7eb5119dc0083616a61b33b89)

src/mon/MonClient.cc

index 982a79887b91ccf8a77360109ea814435b0e673c..7e60ce973b5c38a69286e0e5e459afd4f045f5f9 100644 (file)
@@ -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;