X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Flibrbd%2FObjectMap.cc;h=2913277396bfb325d8ded3c2063e4c26fcbec0c5;hb=f6b5b4d738b87d88d2de35127b6b0e41eae2a272;hp=0d60cc95f94e5790c012993c2e951a8b62c073f9;hpb=12732ca2e80d168d344a265acffc1fbd1fa1f1b5;p=ceph.git diff --git a/ceph/src/librbd/ObjectMap.cc b/ceph/src/librbd/ObjectMap.cc index 0d60cc95f..291327739 100644 --- a/ceph/src/librbd/ObjectMap.cc +++ b/ceph/src/librbd/ObjectMap.cc @@ -163,8 +163,14 @@ void ObjectMap::close(Context *on_finish) { return; } - auto req = object_map::UnlockRequest::create(m_image_ctx, ctx); - req->send(); + ctx = new LambdaContext([this, ctx](int r) { + auto req = object_map::UnlockRequest::create(m_image_ctx, ctx); + req->send(); + }); + + // ensure the block guard for aio updates is empty before unlocking + // the object map + m_async_op_tracker.wait_for_ops(ctx); } template @@ -276,6 +282,7 @@ void ObjectMap::detained_aio_update(UpdateOperation &&op) { lderr(cct) << "failed to detain object map update: " << cpp_strerror(r) << dendl; m_image_ctx.op_work_queue->queue(op.on_finish, r); + m_async_op_tracker.finish_op(); return; } else if (r > 0) { ldout(cct, 20) << "detaining object map update due to in-flight update: " @@ -315,6 +322,7 @@ void ObjectMap::handle_detained_aio_update(BlockGuardCell *cell, int r, } on_finish->complete(r); + m_async_op_tracker.finish_op(); } template