]> 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>
Tue, 8 Aug 2023 12:58:41 +0000 (08:58 -0400)
This avoids infinite recursion when dumping locks with xlock_by
non-null.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
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 a914b9f3015dbc04a6157f0aff8de1a22b83a601..044c33459606f3b0f4e1fd175925cb12ba01af38 100644 (file)
@@ -771,6 +771,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 66ad7944dd76630c49c19554b5e50fe65273b5f5..3381d44c95f150b7c87094e00581261ce7075c1b 100644 (file)
@@ -621,6 +621,7 @@ struct metareqid_t {
     decode(name, p);
     decode(tid, p);
   }
+  void dump(ceph::Formatter *f) const;
 
   entity_name_t name;
   uint64_t tid = 0;