From: John Spray Date: Thu, 7 Aug 2014 17:08:41 +0000 (+0100) Subject: osdc/Journaler: fix C_RetryRead locking X-Git-Tag: v0.86~213^2~32 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3487f21cd7a06ec08d2728466c11f56306fd47f9;p=ceph.git osdc/Journaler: fix C_RetryRead locking Not sure this was ever actually getting used, but it would have had a problem if it was. Signed-off-by: John Spray --- diff --git a/src/osdc/Journaler.cc b/src/osdc/Journaler.cc index 0585e73bb246..579e49b3ca09 100644 --- a/src/osdc/Journaler.cc +++ b/src/osdc/Journaler.cc @@ -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(); } }; diff --git a/src/osdc/Journaler.h b/src/osdc/Journaler.h index 375c5f9ffb9f..6d24c646e122 100644 --- a/src/osdc/Journaler.h +++ b/src/osdc/Journaler.h @@ -297,8 +297,6 @@ private: bool waiting_for_zero; interval_set pending_zero; // non-contig bits we've zeroed std::set 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 > waitfor_safe; // when safe through given offset void _flush(C_OnFinisher *onsafe);