From: Patrick Donnelly Date: Thu, 20 Jul 2023 13:41:53 +0000 (-0400) Subject: mds: dump metareq_t instead of full op X-Git-Tag: v19.0.0~692^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=79c7ddce8a9c9deaf277aa27ca402aa0415420de;p=ceph-ci.git mds: dump metareq_t instead of full op This avoids infinite recursion when dumping locks with xlock_by non-null. Signed-off-by: Patrick Donnelly --- diff --git a/src/mds/Mutation.cc b/src/mds/Mutation.cc index e51348e638d..3c94dfd22e3 100644 --- a/src/mds/Mutation.cc +++ b/src/mds/Mutation.cc @@ -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"); diff --git a/src/mds/SimpleLock.cc b/src/mds/SimpleLock.cc index 4262c1f4856..b23915f9452 100644 --- a/src/mds/SimpleLock.cc +++ b/src/mds/SimpleLock.cc @@ -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(); } diff --git a/src/mds/mdstypes.cc b/src/mds/mdstypes.cc index a914b9f3015..044c3345960 100644 --- a/src/mds/mdstypes.cc +++ b/src/mds/mdstypes.cc @@ -771,6 +771,10 @@ void mds_table_pending_t::generate_test_instances(std::listtid = 35434; } +void metareqid_t::dump(ceph::Formatter* f) const { + f->dump_object("entity", name); + f->dump_unsigned("tid", tid); +} /* * inode_load_vec_t diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 66ad7944dd7..3381d44c95f 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -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;