]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: stop the copyup thread during shutdown
authorJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2015 18:04:20 +0000 (13:04 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2015 18:09:02 +0000 (13:09 -0500)
Fixes: #14107, #14108
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageCtx.cc
src/librbd/image/CloseRequest.cc
src/librbd/image/CloseRequest.h

index 4249ccbefb492124cd590de0b04a2a52a74a7a33..4da886bb70de639ca9d2bcc73e70564673d2168f 100644 (file)
@@ -870,6 +870,7 @@ struct C_InvalidateCache : public Context {
   }
 
   void ImageCtx::flush_copyup(Context *on_finish) {
+    on_finish = util::create_async_context_callback(*this, on_finish);
     if (copyup_finisher == nullptr) {
       on_finish->complete(0);
       return;
index a038dac6802a998195d06b289e07a906c11508f4..2d7ad38343bbbacdce9fe10f1e7d731de1e27913 100644 (file)
@@ -185,6 +185,11 @@ void CloseRequest<I>::handle_shut_down_cache(int r) {
 
 template <typename I>
 void CloseRequest<I>::send_flush_copyup() {
+  if (m_image_ctx->copyup_finisher == nullptr) {
+    send_flush_op_work_queue();
+    return;
+  }
+
   CephContext *cct = m_image_ctx->cct;
   ldout(cct, 10) << this << " " << __func__ << dendl;
 
@@ -196,6 +201,8 @@ template <typename I>
 void CloseRequest<I>::handle_flush_copyup(int r) {
   CephContext *cct = m_image_ctx->cct;
   ldout(cct, 10) << this << " " << __func__ << ": r=" << r << dendl;
+
+  m_image_ctx->copyup_finisher->stop();
   send_flush_op_work_queue();
 }
 
index 1427181dd9658c5a8ba6c5d1469afe680804062f..f22e2dda80b7c1bc66e66e99593f4df44fb105f6 100644 (file)
@@ -49,8 +49,8 @@ private:
    * SHUTDOWN_CACHE
    *    |
    *    v
-   * FLUSH_COPYUP
-   *    |
+   * FLUSH_COPYUP (skip if copyup
+   *    |          disabled)
    *    v
    * FLUSH_OP_WORK_QUEUE  . . . . .
    *    |                         .