From: Jason Dillaman Date: Wed, 29 Jul 2020 11:30:28 +0000 (-0400) Subject: librbd: potentially delay completion of image dispatcher spec X-Git-Tag: wip-pdonnell-testing-20200918.022351~513^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=246802f91514edeb19eff04a6dbeaf778eedf1be;p=ceph-ci.git librbd: potentially delay completion of image dispatcher spec If an AioCompletion is being completed for an external API user, ensure that the completion of image dispatcher finalizer does not race with the potential to close the image. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/io/AioCompletion.cc b/src/librbd/io/AioCompletion.cc index f6015b8a942..cd5df0e7147 100644 --- a/src/librbd/io/AioCompletion.cc +++ b/src/librbd/io/AioCompletion.cc @@ -114,10 +114,6 @@ void AioCompletion::complete() { notify_callbacks_complete(); } - if (image_dispatcher_ctx != nullptr) { - image_dispatcher_ctx->complete(rval); - } - tracepoint(librbd, aio_complete_exit); } @@ -275,6 +271,10 @@ void AioCompletion::notify_callbacks_complete() { cond.notify_all(); } + if (image_dispatcher_ctx != nullptr) { + image_dispatcher_ctx->complete(rval); + } + // note: possible for image to be closed after op marked finished if (async_op.started()) { async_op.finish_op();