]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDSDaemon: make con disposable before passing message to asok 31255/head
authorSage Weil <sage@redhat.com>
Tue, 10 Dec 2019 04:38:57 +0000 (22:38 -0600)
committerSage Weil <sage@redhat.com>
Thu, 12 Dec 2019 19:31:26 +0000 (13:31 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/MDSDaemon.cc

index 16722b584a465301824b5a324ab95eca8a541897..6092a7cae993866ce2ee36da5cb0c50199f98462 100644 (file)
@@ -591,6 +591,22 @@ void MDSDaemon::handle_command(const cref_t<MCommand> &m)
   std::string outs;
   bufferlist outbl;
 
+  // If someone is using a closed session for sending commands (e.g.
+  // the ceph CLI) then we should feel free to clean up this connection
+  // as soon as we've sent them a response.
+  const bool live_session =
+    session->get_state_seq() > 0 &&
+    mds_rank &&
+    mds_rank->sessionmap.get_session(session->info.inst.name);
+
+  if (!live_session) {
+    // This session only existed to issue commands, so terminate it
+    // as soon as we can.
+    ceph_assert(session->is_closed());
+    session->get_connection()->mark_disposable();
+  }
+  priv.reset();
+
   if (!session->auth_caps.allow_all()) {
     dout(1) << __func__
       << ": received command from client without `tell` capability: "
@@ -610,22 +626,6 @@ void MDSDaemon::handle_command(const cref_t<MCommand> &m)
     return;
   }
 
-  // If someone is using a closed session for sending commands (e.g.
-  // the ceph CLI) then we should feel free to clean up this connection
-  // as soon as we've sent them a response.
-  const bool live_session =
-    session->get_state_seq() > 0 &&
-    mds_rank &&
-    mds_rank->sessionmap.get_session(session->info.inst.name);
-
-  if (!live_session) {
-    // This session only existed to issue commands, so terminate it
-    // as soon as we can.
-    ceph_assert(session->is_closed());
-    session->get_connection()->mark_disposable();
-  }
-  priv.reset();
-
   auto reply = make_message<MCommandReply>(r, outs);
   reply->set_tid(m->get_tid());
   reply->set_data(outbl);