From: Somnath Roy Date: Tue, 9 Sep 2014 02:30:46 +0000 (-0700) Subject: OpTracker: The TrackedOp::events list was not protected while dumping ops X-Git-Tag: v0.86~43^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3945ead6d5c64aac70807bce0ba58b4096365296;p=ceph.git OpTracker: The TrackedOp::events list was not protected while dumping ops OpTracker::Mutex::lock is there to protect the event list and it is only used in the mark_event while pushing the events in the list. It is not used while dumping the contents of the events list. Signed-off-by: Somnath Roy --- diff --git a/src/common/TrackedOp.h b/src/common/TrackedOp.h index 5db7fd02b04a..6c28a89dce33 100644 --- a/src/common/TrackedOp.h +++ b/src/common/TrackedOp.h @@ -146,7 +146,7 @@ protected: utime_t initiated_at; list > events; /// list of events and their times - Mutex lock; /// to protect the events list + mutable Mutex lock; /// to protect the events list string current; /// the current state the event is in uint64_t seq; /// a unique value set by the OpTracker diff --git a/src/mds/Mutation.cc b/src/mds/Mutation.cc index 9335189c32fe..2f8954c7aea8 100644 --- a/src/mds/Mutation.cc +++ b/src/mds/Mutation.cc @@ -331,6 +331,7 @@ void MDRequestImpl::_dump(utime_t now, Formatter *f) const } { f->open_array_section("events"); + Mutex::Locker l(lock); for (list >::const_iterator i = events.begin(); i != events.end(); ++i) { diff --git a/src/osd/OpRequest.cc b/src/osd/OpRequest.cc index 8193556312e8..5de80f30d036 100644 --- a/src/osd/OpRequest.cc +++ b/src/osd/OpRequest.cc @@ -51,6 +51,7 @@ void OpRequest::_dump(utime_t now, Formatter *f) const } { f->open_array_section("events"); + Mutex::Locker l(lock); for (list >::const_iterator i = events.begin(); i != events.end(); ++i) {