From: Jason Dillaman Date: Wed, 23 Dec 2015 17:06:50 +0000 (-0500) Subject: librbd: ensure librados callbacks are flushed prior to destroying image X-Git-Tag: v10.0.2~18^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F7040%2Fhead;p=ceph.git librbd: ensure librados callbacks are flushed prior to destroying image Fixes: #14092 Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index 4da886bb70de..6f33962aa413 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -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(); diff --git a/src/test/librbd/mock/MockImageCtx.h b/src/test/librbd/mock/MockImageCtx.h index 7368a52a23aa..c19692094e3d 100644 --- a/src/test/librbd/mock/MockImageCtx.h +++ b/src/test/librbd/mock/MockImageCtx.h @@ -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;