From d6fde6a65d22f630e3a848e7122825fa06b5ef19 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Wed, 31 Jan 2024 14:28:14 -0500 Subject: [PATCH] mds: print internal_request filepaths if present Signed-off-by: Patrick Donnelly (cherry picked from commit eaea93e05018294e893e0e5241b3293e10971f5e) --- src/mds/Mutation.cc | 20 ++++++++++++++++++-- src/mds/Mutation.h | 5 +++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/mds/Mutation.cc b/src/mds/Mutation.cc index 9b71e244e08..f866f663359 100644 --- a/src/mds/Mutation.cc +++ b/src/mds/Mutation.cc @@ -287,6 +287,12 @@ MDRequestImpl::More* MDRequestImpl::more() return _more; } +MDRequestImpl::More const* MDRequestImpl::more() const +{ + ceph_assert(_more); + return _more; +} + bool MDRequestImpl::has_more() const { return _more != nullptr; @@ -373,14 +379,14 @@ void MDRequestImpl::drop_local_auth_pins() MutationImpl::drop_local_auth_pins(); } -const filepath& MDRequestImpl::get_filepath() +const filepath& MDRequestImpl::get_filepath() const { if (client_request) return client_request->get_filepath(); return more()->filepath1; } -const filepath& MDRequestImpl::get_filepath2() +const filepath& MDRequestImpl::get_filepath2() const { if (client_request) return client_request->get_filepath2(); @@ -549,6 +555,16 @@ void MDRequestImpl::_dump_op_descriptor(ostream& os) const os << "peer_request:" << reqid; } else if (internal_op >= 0) { os << "internal op " << ceph_mds_op_name(internal_op) << ":" << reqid; + if (has_more()) { + auto& fp = get_filepath(); + if (!fp.empty()) { + os << " fp=" << fp; + } + auto& fp2 = get_filepath2(); + if (!fp2.empty()) { + os << " fp2=" << fp2; + } + } } else { // drat, it's triggered by a peer request, but we don't have a message // FIXME diff --git a/src/mds/Mutation.h b/src/mds/Mutation.h index 297524a28c0..a8a89e1ef3f 100644 --- a/src/mds/Mutation.h +++ b/src/mds/Mutation.h @@ -389,6 +389,7 @@ struct MDRequestImpl : public MutationImpl { ~MDRequestImpl() override; More* more(); + More const* more() const; bool has_more() const; bool has_witnesses(); bool peer_did_prepare(); @@ -400,8 +401,8 @@ struct MDRequestImpl : public MutationImpl { void drop_local_auth_pins(); void set_ambiguous_auth(CInode *inode); void clear_ambiguous_auth(); - const filepath& get_filepath(); - const filepath& get_filepath2(); + const filepath& get_filepath() const; + const filepath& get_filepath2() const; void set_filepath(const filepath& fp); void set_filepath2(const filepath& fp); bool is_queued_for_replay() const; -- 2.39.5