mds: lock TrackedOp when dumping

The MDS does not generally bother locking a Mutation before changing
anything so this lock provides weak protection. In any case, try to
improve on that...

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
Patrick Donnelly 2023-07-21 12:56:27 -04:00
parent 60d1bdb1f5
commit 9d75d6b0bd
No known key found for this signature in database
GPG Key ID: FA47FD0B0367D313

View File

@ -481,6 +481,7 @@ void MDRequestImpl::dump(Formatter *f) const
void MDRequestImpl::_dump(Formatter *f) const
{
std::lock_guard l(lock);
f->dump_string("flag_point", _get_state_string());
f->dump_stream("reqid") << reqid;
{
@ -527,9 +528,9 @@ void MDRequestImpl::_dump(Formatter *f) const
f->dump_string("op_type", "no_available_op_found");
}
}
{
f->open_array_section("events");
std::lock_guard l(lock);
for (auto& i : events) {
f->dump_object("event", i);
}