]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: ensure librados callbacks are flushed prior to destroying image 7040/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 23 Dec 2015 17:06:50 +0000 (12:06 -0500)
committerJason Dillaman <dillaman@redhat.com>
Wed, 23 Dec 2015 17:06:50 +0000 (12:06 -0500)
Fixes: #14092
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageCtx.cc
src/test/librbd/mock/MockImageCtx.h

index 4da886bb70de639ca9d2bcc73e70564673d2168f..6f33962aa413afb7033c0ce8f9f46ba557f0d26b 100644 (file)
@@ -212,6 +212,8 @@ struct C_InvalidateCache : public Context {
     }
     delete[] format_string;
 
+    md_ctx.aio_flush();
+    data_ctx.aio_flush();
     op_work_queue->drain();
     aio_work_queue->drain();
 
index 7368a52a23aa9bd4b53320877c376b27e86ff5d8..c19692094e3d27b9dda562e0eb3f45ba38a62504 100644 (file)
@@ -57,6 +57,8 @@ struct MockImageCtx {
 
   ~MockImageCtx() {
     wait_for_async_requests();
+    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;