mirror of
https://github.com/ceph/ceph
synced 2025-01-10 21:20:46 +00:00
Merge pull request #36324 from dillaman/wip-46737
librbd: ensure image cannot be closed until in-flight IO callbacks complete Reviewed-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
commit
a760349344
@ -111,14 +111,6 @@ void AioCompletion::complete() {
|
||||
notify_callbacks_complete();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
tracepoint(librbd, aio_complete_exit);
|
||||
}
|
||||
|
||||
@ -283,8 +275,19 @@ void AioCompletion::complete_event_socket() {
|
||||
void AioCompletion::notify_callbacks_complete() {
|
||||
state = AIO_STATE_COMPLETE;
|
||||
|
||||
std::unique_lock<std::mutex> locker(lock);
|
||||
cond.notify_all();
|
||||
{
|
||||
std::unique_lock<std::mutex> locker(lock);
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace io
|
||||
|
Loading…
Reference in New Issue
Block a user