From 3487f21cd7a06ec08d2728466c11f56306fd47f9 Mon Sep 17 00:00:00 2001 From: John Spray Date: Thu, 7 Aug 2014 18:08:41 +0100 Subject: [PATCH] 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 --- src/osdc/Journaler.cc | 3 ++- src/osdc/Journaler.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/osdc/Journaler.cc b/src/osdc/Journaler.cc index 0585e73bb2467..579e49b3ca09e 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 375c5f9ffb9fe..6d24c646e1221 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); -- 2.39.5