]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Journaler: fix C_RetryRead locking
authorJohn Spray <john.spray@redhat.com>
Thu, 7 Aug 2014 17:08:41 +0000 (18:08 +0100)
committerJohn Spray <john.spray@redhat.com>
Mon, 25 Aug 2014 00:34:18 +0000 (01:34 +0100)
Not sure this was ever actually getting used, but
it would have had a problem if it was.

Signed-off-by: John Spray <john.spray@redhat.com>
src/osdc/Journaler.cc
src/osdc/Journaler.h

index 0585e73bb246735affdbcf594e3c9a447796247c..579e49b3ca09ef863080ef0bd8f819bf6c752966 100644 (file)
@@ -795,7 +795,8 @@ class Journaler::C_RetryRead : public Context {
 public:
   C_RetryRead(Journaler *l) : ls(l) {}
   void finish(int r) {
-    Mutex::Locker l(ls->lock);
+    // Should only be called from waitfor_safe i.e. already inside lock
+    assert(ls->lock.is_locked_by_me());
     ls->_prefetch();
   }  
 };
index 375c5f9ffb9fe2ba23fa6b242f324a700edb5bbb..6d24c646e122128a372936dd6adbbd15baca69cf 100644 (file)
@@ -297,8 +297,6 @@ private:
   bool waiting_for_zero;
   interval_set<uint64_t> pending_zero;  // non-contig bits we've zeroed
   std::set<uint64_t> pending_safe;
-  // XXX this would be C_OnFinisher reather than Context if it weren't for use of C_RetryRead here
-  // FIXME but oh dear, these are called back inside lock and RetryRead takes the lock!!!
   std::map<uint64_t, std::list<Context*> > waitfor_safe; // when safe through given offset
 
   void _flush(C_OnFinisher *onsafe);