mirror of
https://github.com/ceph/ceph
synced 2024-12-18 01:16:55 +00:00
librados/AioCompletionImpl.h: add missing Lock
Add missing Lock around code changing AioCompletionImpl::rval/ack and safe in C_AioCompleteAndSafe::finish(). CID 1019565 (#1 of 1): Data race condition (MISSING_LOCK) missing_lock: Accessing "this->c->rval" ("_ZN8librados17AioCompletionImplE.rval") requires the "Mutex._m" lock. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
parent
8a52350dd8
commit
088455f85e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user