From: Sage Weil Date: Mon, 15 Sep 2014 23:45:19 +0000 (-0700) Subject: osdc/Objecter: fix command op cancellation race X-Git-Tag: v0.86~60^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2498%2Fhead;p=ceph.git osdc/Objecter: fix command op cancellation race Cancel the command op timeout event before we clear out the op from the session struct. This isn't strictly necessary because command_op_cancel will "gracefully" handle the case where the tid is no longer present, but this avoids that noise and is cleaner. Signed-off-by: Sage Weil --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 22a5f10359a..cbaf7ad2b01 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -3875,14 +3875,15 @@ void Objecter::_finish_command(CommandOp *c, int r, string rs) if (c->onfinish) c->onfinish->complete(r); + if (c->ontimeout) { + timer.cancel_event(c->ontimeout); + } + OSDSession *s = c->session; s->lock.get_write(); _session_command_op_remove(c->session, c); s->lock.unlock(); - if (c->ontimeout) { - timer.cancel_event(c->ontimeout); - } c->put(); logger->dec(l_osdc_command_active);