]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
librbd: use task finisher thread for image open/close callbacks
authorJason Dillaman <dillaman@redhat.com>
Fri, 24 Jul 2020 16:13:10 +0000 (12:13 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 27 Jul 2020 13:15:15 +0000 (09:15 -0400)
commit90bd1d7a857c0f3c57bda60975f58f9859940185
treef6512ec74322df9dbaa73ba132368cf9e5e23816
parent1613d272f43f11c444da3e53de96415d6968659a
librbd: use task finisher thread for image open/close callbacks

There was a potential race condition with utilizing the AsioEngine
to deliver asynchronous image open and close callbacks. This left
the potential for the io_context thread to attempt to destroy itself.

This commit changes the behavior of the image open and close callbacks
to always delete the ImageCtx (now matches the synchronous API behavior)
and it always invokes the callback in Finisher thread whose lifetime is
tied to the CephContext.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
28 files changed:
src/librbd/ImageCtx.h
src/librbd/ImageState.cc
src/librbd/TaskFinisher.h
src/librbd/api/Group.cc
src/librbd/deep_copy/ImageCopyRequest.cc
src/librbd/image/CloneRequest.cc
src/librbd/image/CloseRequest.cc
src/librbd/image/DetachChildRequest.cc
src/librbd/image/RefreshParentRequest.cc
src/librbd/image/RemoveRequest.cc
src/librbd/io/AioCompletion.cc
src/librbd/librbd.cc
src/librbd/mirror/EnableRequest.cc
src/librbd/trash/RemoveRequest.cc
src/test/librbd/deep_copy/test_mock_ImageCopyRequest.cc
src/test/librbd/image/test_mock_CloneRequest.cc
src/test/librbd/image/test_mock_DetachChildRequest.cc
src/test/librbd/image/test_mock_RemoveRequest.cc
src/test/librbd/mock/MockImageCtx.h
src/test/librbd/operation/test_mock_ResizeRequest.cc
src/test/librbd/trash/test_mock_RemoveRequest.cc
src/test/rbd_mirror/image_deleter/test_mock_SnapshotPurgeRequest.cc
src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc
src/tools/rbd_mirror/image_deleter/SnapshotPurgeRequest.cc
src/tools/rbd_mirror/image_deleter/TrashMoveRequest.cc
src/tools/rbd_mirror/image_replayer/CloseImageRequest.cc
src/tools/rbd_mirror/image_replayer/OpenImageRequest.cc
src/tools/rbd_mirror/image_replayer/OpenLocalImageRequest.cc