]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: potentially delay completion of image dispatcher spec 36324/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 29 Jul 2020 11:30:28 +0000 (07:30 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 29 Jul 2020 11:30:28 +0000 (07:30 -0400)
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 <dillaman@redhat.com>
src/librbd/io/AioCompletion.cc

index f6015b8a942d8c6906e9dd1a18f50201bf50e3ae..cd5df0e7147e81f18258997ffe22e4e947e1635f 100644 (file)
@@ -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();