mirror of
https://github.com/ceph/ceph
synced 2025-01-29 14:34:40 +00:00
mds: avoid recursive locks dumping state
Also: fix return to std::string. A string_view is not a thread-safe return. Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
parent
36eaa495eb
commit
60d1bdb1f5
@ -392,9 +392,9 @@ public:
|
|||||||
warn_interval_multiplier = 0;
|
warn_interval_multiplier = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string_view state_string() const {
|
std::string state_string() const {
|
||||||
std::lock_guard l(lock);
|
std::lock_guard l(lock);
|
||||||
return events.empty() ? std::string_view() : std::string_view(events.rbegin()->str);
|
return _get_state_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump(utime_t now, ceph::Formatter *f) const;
|
void dump(utime_t now, ceph::Formatter *f) const;
|
||||||
@ -414,6 +414,11 @@ public:
|
|||||||
friend void intrusive_ptr_release(TrackedOp *o) {
|
friend void intrusive_ptr_release(TrackedOp *o) {
|
||||||
o->put();
|
o->put();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual std::string _get_state_string() const {
|
||||||
|
return events.empty() ? std::string() : std::string(events.rbegin()->str);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -481,7 +481,7 @@ void MDRequestImpl::dump(Formatter *f) const
|
|||||||
|
|
||||||
void MDRequestImpl::_dump(Formatter *f) const
|
void MDRequestImpl::_dump(Formatter *f) const
|
||||||
{
|
{
|
||||||
f->dump_string("flag_point", state_string());
|
f->dump_string("flag_point", _get_state_string());
|
||||||
f->dump_stream("reqid") << reqid;
|
f->dump_stream("reqid") << reqid;
|
||||||
{
|
{
|
||||||
msg_lock.lock();
|
msg_lock.lock();
|
||||||
|
@ -113,7 +113,7 @@ public:
|
|||||||
return latest_flag_point;
|
return latest_flag_point;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view state_string() const override {
|
std::string _get_state_string() const override {
|
||||||
switch(latest_flag_point) {
|
switch(latest_flag_point) {
|
||||||
case flag_queued_for_pg: return "queued for pg";
|
case flag_queued_for_pg: return "queued for pg";
|
||||||
case flag_reached_pg: return "reached pg";
|
case flag_reached_pg: return "reached pg";
|
||||||
|
Loading…
Reference in New Issue
Block a user