]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/ImageWatcher.cc
import ceph quincy 17.2.4
[ceph.git] / ceph / src / librbd / ImageWatcher.cc
index f4fdc54b90d116196bbd20932c7aba21dc712abc..f5a27e0c2bbafc6496f80940e63d130e99f98578 100644 (file)
@@ -572,12 +572,11 @@ template <typename I>
 void ImageWatcher<I>::schedule_request_lock(bool use_timer, int timer_delay) {
   ceph_assert(ceph_mutex_is_locked(m_image_ctx.owner_lock));
 
-  if (m_image_ctx.exclusive_lock == nullptr) {
-    // exclusive lock dynamically disabled via image refresh
+  // see notify_request_lock()
+  if (m_image_ctx.exclusive_lock == nullptr ||
+      m_image_ctx.exclusive_lock->is_lock_owner()) {
     return;
   }
-  ceph_assert(m_image_ctx.exclusive_lock &&
-              !m_image_ctx.exclusive_lock->is_lock_owner());
 
   std::shared_lock watch_locker{this->m_watch_lock};
   if (this->is_registered(this->m_watch_lock)) {