]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: reacquire lock should update lock owner client id 17385/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 31 Aug 2017 00:59:20 +0000 (20:59 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 31 Aug 2017 01:00:12 +0000 (21:00 -0400)
(derived from commit 21ce5e16703776cbae20ac981dff4ec7cc2bc9c8)

Fixes: http://tracker.ceph.com/issues/19957
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ExclusiveLock.cc
src/test/librbd/test_mock_ExclusiveLock.cc

index 43ed31b6c295eacf57901dccc81ce7839d363503..5dc6a541b2cb0eae0c0a10e2de11b9b12f54df6c 100644 (file)
@@ -603,6 +603,10 @@ void ExclusiveLock<I>::handle_reacquire_lock(int r) {
     }
   } else {
     m_cookie = m_new_cookie;
+
+    m_lock.Unlock();
+    m_image_ctx.image_watcher->notify_acquired_lock();
+    m_lock.Lock();
   }
 
   complete_active_action(STATE_LOCKED, 0);
index df6a4ae35f11300ffce7bb055f53d5d80bd23b57..dda9c0ec00f43428aa4a4074dd121cc330705383 100644 (file)
@@ -709,6 +709,7 @@ TEST_F(TestMockExclusiveLock, ReacquireLock) {
   MockReacquireRequest mock_reacquire_request;
   C_SaferCond reacquire_ctx;
   expect_reacquire_lock(mock_image_ctx, mock_reacquire_request, 0);
+  expect_notify_acquired_lock(mock_image_ctx);
   {
     RWLock::RLocker owner_locker(mock_image_ctx.owner_lock);
     exclusive_lock.reacquire_lock(&reacquire_ctx);