diff --git a/src/librados/AioCompletionImpl.h b/src/librados/AioCompletionImpl.h index b3e1e8a16e2..34462d22063 100644 --- a/src/librados/AioCompletionImpl.h +++ b/src/librados/AioCompletionImpl.h @@ -212,9 +212,11 @@ struct C_AioCompleteAndSafe : public Context { } void finish(int r) { + c->lock.Lock(); c->rval = r; c->ack = true; c->safe = true; + c->lock.Unlock(); rados_callback_t cb_complete = c->callback_complete; void *cb_arg = c->callback_arg; if (cb_complete)