]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: ensure librados callbacks are flushed prior to destroying image 7484/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 23 Dec 2015 17:06:50 +0000 (12:06 -0500)
committerJason Dillaman <dillaman@redhat.com>
Thu, 11 Feb 2016 15:02:55 +0000 (10:02 -0500)
Fixes: #14092
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 98157ab3274bd960e4487e34f5a83e9c921a6ac8)

src/librbd/ImageCtx.cc
src/test/librbd/mock/MockImageCtx.h

index d04b0970059e9440d1fa02f28f089e31d38bfbfc..d50a528f983ba8e9cf82a63c8b3e236cc8393149 100644 (file)
@@ -208,6 +208,11 @@ void _flush_async_operations(ImageCtx *ictx, Context *on_finish) {
     }
     delete[] format_string;
 
+    md_ctx.aio_flush();
+    data_ctx.aio_flush();
+    op_work_queue->drain();
+    aio_work_queue->drain();
+
     delete op_work_queue;
     delete aio_work_queue;
   }
index 53d6fd0d01e1d7907189ffb1b0f1a704cbcb2e9a..8af8f5d32d7ad8deaaf673af68d51f1296b687cb 100644 (file)
@@ -47,6 +47,9 @@ struct MockImageCtx {
   }
 
   ~MockImageCtx() {
+    image_ctx->md_ctx.aio_flush();
+    image_ctx->data_ctx.aio_flush();
+    image_ctx->op_work_queue->drain();
     delete image_watcher;
     delete op_work_queue;
     delete aio_work_queue;