info->on_reg_commit->complete(r);
info->on_reg_commit = NULL;
}
+ if (r < 0 && info->on_notify_finish) {
+ info->on_notify_finish->complete(r);
+ info->on_notify_finish = nullptr;
+ }
// only tell the user the first time we do this
info->registered = true;
}
if (op->map_dne_bound > 0) {
if (osdmap->get_epoch() >= op->map_dne_bound) {
+ LingerOp::unique_lock wl{op->watch_lock};
if (op->on_reg_commit) {
op->on_reg_commit->complete(-ENOENT);
+ op->on_reg_commit = nullptr;
+ }
+ if (op->on_notify_finish) {
+ op->on_notify_finish->complete(-ENOENT);
+ op->on_notify_finish = nullptr;
}
*need_unregister = true;
}
if (c->map_dne_bound == 0)
c->map_dne_bound = latest;
+ OSDSession::unique_lock sul(c->session->lock);
objecter->_check_command_map_dne(c);
+ sul.unlock();
c->put();
}
void Objecter::_check_command_map_dne(CommandOp *c)
{
// rwlock is locked unique
+ // session is locked unique
ldout(cct, 10) << "_check_command_map_dne tid " << c->tid
<< " current " << osdmap->get_epoch()
void Objecter::_send_command_map_check(CommandOp *c)
{
// rwlock is locked unique
+ // session is locked unique
// ask the monitor
if (check_latest_map_commands.count(c->tid) == 0) {
sl.unlock();
-
+ OSDSession::unique_lock sul(s->lock);
_finish_command(c, m->r, m->rs);
+ sul.unlock();
+
m->put();
if (s)
s->put();
CommandOp *op = it->second;
_command_cancel_map_check(op);
+ OSDSession::unique_lock sl(op->session->lock);
_finish_command(op, r, "");
+ sl.unlock();
return 0;
}
void Objecter::_finish_command(CommandOp *c, int r, string rs)
{
// rwlock is locked unique
+ // session lock is locked
ldout(cct, 10) << "_finish_command " << c->tid << " = " << r << " "
<< rs << dendl;
timer.cancel_event(c->ontimeout);
OSDSession *s = c->session;
- OSDSession::unique_lock sl(s->lock);
_session_command_op_remove(c->session, c);
- sl.unlock();
c->put();