]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: dump metareq_t instead of full op
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 20 Jul 2023 13:41:53 +0000 (09:41 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 9 Oct 2023 15:37:39 +0000 (11:37 -0400)
This avoids infinite recursion when dumping locks with xlock_by
non-null.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 79c7ddce8a9c9deaf277aa27ca402aa0415420de)

src/mds/Mutation.cc
src/mds/SimpleLock.cc
src/mds/mdstypes.cc
src/mds/mdstypes.h

index e51348e638d5f133d247a4cc9de77a2e149b380c..3c94dfd22e366f87d50ce6d419378eef79123d9e 100644 (file)
@@ -478,7 +478,7 @@ void MDRequestImpl::_dump(Formatter *f) const
 {
   std::lock_guard l(lock);
   f->dump_string("flag_point", _get_state_string());
-  f->dump_stream("reqid") << reqid;
+  f->dump_object("reqid", reqid);
   if (client_request) {
     f->dump_string("op_type", "client_request");
     f->open_object_section("client_info");
index 4262c1f4856c2c93d1b48c7717ec9b6838e594a8..b23915f945219bbbe17c278ffb108547df301cd7 100644 (file)
@@ -37,8 +37,8 @@ void SimpleLock::dump(ceph::Formatter *f) const {
   f->dump_int("num_wrlocks", get_num_wrlocks());
   f->dump_int("num_xlocks", get_num_xlocks());
   f->open_object_section("xlock_by");
-  if (get_xlock_by()) {
-    get_xlock_by()->dump(f);
+  if (auto mut = get_xlock_by(); mut) {
+    f->dump_object("reqid", mut->reqid);
   }
   f->close_section();
 }
index 1588c1acf9eddcfd95346161f1742d8284b40653..2b1e037a6dd78748482d4f4a5cd3893f0947bc0b 100644 (file)
@@ -770,6 +770,10 @@ void mds_table_pending_t::generate_test_instances(std::list<mds_table_pending_t*
   ls.back()->tid = 35434;
 }
 
+void metareqid_t::dump(ceph::Formatter* f) const {
+  f->dump_object("entity", name);
+  f->dump_unsigned("tid", tid);
+}
 
 /*
  * inode_load_vec_t
index bfb27910846b2ed6c7d87d4e4f833dc206b6af9f..b20e28bc54f02e9237691911b19937fe3e2edcfb 100644 (file)
@@ -1483,6 +1483,7 @@ struct metareqid_t {
     decode(name, p);
     decode(tid, p);
   }
+  void dump(ceph::Formatter *f) const;
 
   entity_name_t name;
   uint64_t tid = 0;