]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: fix command op cancellation race 2498/head
authorSage Weil <sage@redhat.com>
Mon, 15 Sep 2014 23:45:19 +0000 (16:45 -0700)
committerSage Weil <sage@redhat.com>
Mon, 15 Sep 2014 23:45:19 +0000 (16:45 -0700)
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 <sage@redhat.com>
src/osdc/Objecter.cc

index 22a5f10359af1a533e4a36fe2cf01c592f4f9e27..cbaf7ad2b01c12754b0799e9bd3e1c1688496743 100644 (file)
@@ -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);