]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: skip unexpected command replies 60746/head
authorPatrick Donnelly <pdonnell@ibm.com>
Tue, 18 Feb 2025 19:35:16 +0000 (14:35 -0500)
committerPatrick Donnelly <pdonnell@ibm.com>
Fri, 28 Feb 2025 00:55:47 +0000 (19:55 -0500)
Instead of marking the message as handled, give another component (or Client) a
chance to process.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/client/Client.cc
src/client/Client.h

index 51298d90a59a2dac4bafc5d48a9a44c2a11573f0..374918a5c2904b6753f8d2183e999fcf86720c22 100644 (file)
@@ -3131,8 +3131,11 @@ Dispatcher::dispatch_result_t Client::ms_dispatch2(const MessageRef &m)
     break;
   case MSG_COMMAND_REPLY:
     if (m->get_source().type() == CEPH_ENTITY_TYPE_MDS) {
-      handle_command_reply(ref_cast<MCommandReply>(m));
-      return Dispatcher::HANDLED();
+      if (handle_command_reply(ref_cast<MCommandReply>(m))) {
+        return Dispatcher::HANDLED();
+      } else {
+        return Dispatcher::UNHANDLED();
+      }
     } else {
       return Dispatcher::UNHANDLED();
     }
@@ -6686,7 +6689,7 @@ int Client::mds_command(
   return 0;
 }
 
-void Client::handle_command_reply(const MConstRef<MCommandReply>& m)
+bool Client::handle_command_reply(const MConstRef<MCommandReply>& m)
 {
   ceph_tid_t const tid = m->get_tid();
 
@@ -6695,7 +6698,7 @@ void Client::handle_command_reply(const MConstRef<MCommandReply>& m)
   std::scoped_lock cmd_lock(command_lock);
   if (!command_table.exists(tid)) {
     ldout(cct, 1) << __func__ << ": unknown tid " << tid << ", dropping" << dendl;
-    return;
+    return false;
   }
 
   auto &op = command_table.get_command(tid);
@@ -6736,6 +6739,7 @@ void Client::handle_command_reply(const MConstRef<MCommandReply>& m)
   }
 
   command_table.erase(tid);
+  return true;
 }
 
 // -------------------
index ac600f434b28bbc1257ff73bd65c28f369261819..3fd3e9201e4b568ebe8a4a97ab18a8fdb0c3a51a 100644 (file)
@@ -983,7 +983,7 @@ protected:
 
   void set_cap_epoch_barrier(epoch_t e);
 
-  void handle_command_reply(const MConstRef<MCommandReply>& m);
+  bool handle_command_reply(const MConstRef<MCommandReply>& m);
   int fetch_fsmap(bool user);
   int resolve_mds(
       const std::string &mds_spec,