]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: ignore attempts to request lock if already lock owner
authorJason Dillaman <dillaman@redhat.com>
Fri, 30 Sep 2016 16:32:37 +0000 (12:32 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 5 Oct 2016 01:31:54 +0000 (21:31 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageWatcher.cc

index ea875736b405c53ef07f06a7460af9a610d406f4..a261500abc0b01b72d6b34d472617954739d970b 100644 (file)
@@ -475,11 +475,12 @@ void ImageWatcher<I>::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) {
+  // ExclusiveLock state machine can be dynamically disabled or
+  // race with task cancel
+  if (m_image_ctx.exclusive_lock == nullptr ||
+      m_image_ctx.exclusive_lock->is_lock_owner()) {
     return;
   }
-  assert(!m_image_ctx.exclusive_lock->is_lock_owner());
 
   ldout(m_image_ctx.cct, 10) << this << " notify request lock" << dendl;