]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: Add tailing closing square bracket once in handle_command_reply
authorJimyeong Lee <jinmyeong.lee@linecorp.com>
Wed, 2 Aug 2023 00:17:07 +0000 (09:17 +0900)
committerRishabh Dave <ridave@redhat.com>
Wed, 8 Nov 2023 17:18:39 +0000 (22:48 +0530)
Delete unnecessary method, Add multi_id to logs

Signed-off-by: Jimyeong Lee <jinmyeong.lee@linecorp.com>
(cherry picked from commit d1721a4f00a90be194e571ccd0ea19dc2266f0c6)

src/client/Client.cc
src/common/CommandTable.h

index 6a56f8073ecb60d0f397b11bfe41a8fef1358111..a8b2320e9ed940cb91e33249eb7ec9a85ef1ef3f 100644 (file)
@@ -6383,7 +6383,7 @@ int Client::mds_command(
       op.con = conn;
 
       ldout(cct, 4) << __func__ << ": new command op to " << target_gid
-        << " tid=" << op.tid << cmd << dendl;
+        << " tid=" << op.tid << " multi_id=" << op.multi_target_id << " "<< cmd << dendl;
 
       // Construct and send MCommand
       MessageRef m = op.get_message(monclient->get_fsid());
@@ -6409,7 +6409,7 @@ void Client::handle_command_reply(const MConstRef<MCommandReply>& m)
   }
 
   auto &op = command_table.get_command(tid);
-  ceph_tid_t multi_id = command_table.get_multi_target_id(tid);
+  ceph_tid_t multi_id = op.multi_target_id;
 
   if (op.outbl) {
     if (multi_id != 0 && m->r == 0) {
@@ -6432,7 +6432,7 @@ void Client::handle_command_reply(const MConstRef<MCommandReply>& m)
     }
     else {
       // when this command is the last one
-      if (command_table.count_multi_commands(multi_id) <= 1) {
+      if (command_table.count_multi_commands(multi_id) == 1) {
         op.outbl->append("]");
       }
     }
index cf57ee5e0ac3a73347b9f8ef64bc67f18d33f743..e777d72dcf56b99bec4d9b8469066e12b5eafdf1 100644 (file)
@@ -122,11 +122,6 @@ public:
     return commands.at(tid);
   }
 
-  bool get_multi_target_id(ceph_tid_t tid) const
-  {
-    return commands.at(tid).multi_target_id;
-  }
-
   void erase(ceph_tid_t tid)
   {
     ceph_tid_t multi_id = commands.at(tid).multi_target_id;