]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: dynamically disabling exclusive lock might leave lingering request 8511/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 14 Apr 2016 12:14:46 +0000 (08:14 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 14 Apr 2016 12:14:46 +0000 (08:14 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageWatcher.cc

index df8f366520d45aa67108fb804760adec8dd35c94..de337c289e3c119de7d2d93980aa237b64af8714 100644 (file)
@@ -403,6 +403,11 @@ void ImageWatcher::schedule_request_lock(bool use_timer, int timer_delay) {
 void ImageWatcher::notify_request_lock() {
   RWLock::RLocker owner_locker(m_image_ctx.owner_lock);
   RWLock::RLocker snap_locker(m_image_ctx.snap_lock);
+
+  // ExclusiveLock state machine can be dynamically disabled
+  if (m_image_ctx.exclusive_lock == nullptr) {
+    return;
+  }
   assert(!m_image_ctx.exclusive_lock->is_lock_owner());
 
   ldout(m_image_ctx.cct, 10) << this << " notify request lock" << dendl;