From 56ba3411745ac4f70f3b4f7843c04a5c33c0b842 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 15 Sep 2014 16:45:19 -0700 Subject: [PATCH] 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 --- src/osdc/Objecter.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); -- 2.47.3