]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OpTracker: The TrackedOp::events list was not protected while dumping ops
authorSomnath Roy <somnath.roy@sandisk.com>
Tue, 9 Sep 2014 02:30:46 +0000 (19:30 -0700)
committerSomnath Roy <somnath.roy@sandisk.com>
Thu, 11 Sep 2014 18:22:59 +0000 (11:22 -0700)
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 <somnath.roy@sandisk.com>
src/common/TrackedOp.h
src/mds/Mutation.cc
src/osd/OpRequest.cc

index 5db7fd02b04a221fbd4fac11d75d298efe23b796..6c28a89dce33959c33aa41921e66f7c8f27b61db 100644 (file)
@@ -146,7 +146,7 @@ protected:
 
   utime_t initiated_at;
   list<pair<utime_t, string> > 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
 
index 9335189c32fe1d0844baad81d42d71e4caa8e71a..2f8954c7aea8ad019f18d2a523dc5efefe8f38aa 100644 (file)
@@ -331,6 +331,7 @@ void MDRequestImpl::_dump(utime_t now, Formatter *f) const
   }
   {
     f->open_array_section("events");
+    Mutex::Locker l(lock);
     for (list<pair<utime_t, string> >::const_iterator i = events.begin();
          i != events.end();
          ++i) {
index 8193556312e84ac530266ec34633e308d39733c2..5de80f30d036f97b61e0ea3d25ec3245e788e0f6 100644 (file)
@@ -51,6 +51,7 @@ void OpRequest::_dump(utime_t now, Formatter *f) const
   }
   {
     f->open_array_section("events");
+    Mutex::Locker l(lock);
     for (list<pair<utime_t, string> >::const_iterator i = events.begin();
         i != events.end();
         ++i) {