]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Pass the result of PreReleaseRequest to next handler. 20112/head
authorliyichao <liyichao.good@gmail.com>
Wed, 16 May 2018 13:21:52 +0000 (21:21 +0800)
committerliyichao <liyichao.good@gmail.com>
Wed, 16 May 2018 13:21:52 +0000 (21:21 +0800)
We have to pass the error code so PreReleaseRequest is considered
failed so that in `ExclusiveLock<I>::post_release_lock_handler`,
`io_work_queue->unblock_writes` will be not called because
it is already called in PreReleaseRequest.

Signed-off-by: liyichao <liyichao.good@gmail.com>
src/librbd/ManagedLock.cc

index 53bfd2622665531d0272e8897b8f26e5a059bee5..f039eb405152daafba974f777d651e6e930ed840 100644 (file)
@@ -762,8 +762,9 @@ void ManagedLock<I>::handle_shutdown_pre_release(int r) {
   using managed_lock::ReleaseRequest;
   ReleaseRequest<I>* req = ReleaseRequest<I>::create(m_ioctx, m_watcher,
       m_work_queue, m_oid, cookie,
-      new FunctionContext([this](int r) {
-        post_release_lock_handler(true, r, create_context_callback<
+      new FunctionContext([this, r](int l) {
+        int rst = r < 0 ? r : l;
+        post_release_lock_handler(true, rst, create_context_callback<
             ManagedLock<I>, &ManagedLock<I>::handle_shutdown_post_release>(this));
       }));
   req->send();