This implicitly fixes an issue with the list_objects() being reentrant,
and triggers a lock dependency issue. The better solution would be to
have the callback context specify whether it's reentrant or not, but
will require a much bigger change.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
}
/* get it before we call _finish_op() */
- Mutex *completion_lock = s->get_lock(op->target.base_oid);
+ Mutex *completion_lock = (op->target.base_oid.name.size() ? s->get_lock(op->target.base_oid) : NULL);
// done with this tid?
if (!op->onack && !op->oncommit) {
ldout(cct, 5) << num_unacked.read() << " unacked, " << num_uncommitted.read() << " uncommitted" << dendl;
// serialize completions
-
- completion_lock->Lock();
+ if (completion_lock) {
+ completion_lock->Lock();
+ }
s->lock.unlock();
// do callbacks
if (oncommit) {
oncommit->complete(rc);
}
- completion_lock->Unlock();
+ if (completion_lock) {
+ completion_lock->Unlock();
+ }
m->put();
s->put();