From: Jason Dillaman Date: Fri, 30 Sep 2016 16:32:37 +0000 (-0400) Subject: librbd: ignore attempts to request lock if already lock owner X-Git-Tag: v11.1.0~709^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=355c79cb7c955e62e3153cf28046a9b8a6d0d25c;p=ceph.git librbd: ignore attempts to request lock if already lock owner Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/ImageWatcher.cc b/src/librbd/ImageWatcher.cc index ea875736b405c..a261500abc0b0 100644 --- a/src/librbd/ImageWatcher.cc +++ b/src/librbd/ImageWatcher.cc @@ -475,11 +475,12 @@ 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) { + // 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;