]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: fix ref counts in *Map_Latest
authorJohn Spray <john.spray@redhat.com>
Sat, 23 Aug 2014 19:03:47 +0000 (20:03 +0100)
committerJohn Spray <john.spray@redhat.com>
Mon, 25 Aug 2014 00:34:19 +0000 (01:34 +0100)
These contexts were putting before continuing to
use the CommandOp/LingerOp.  I added an assert to
reflect that, which was hitting (#9207).

This change is to remove the assertion and put the
put() in the right place (and the end of the function).

Fixes: #9207
Signed-off-by: John Spray <john.spray@redhat.com>
src/osdc/Objecter.cc

index 27a203649c40df842b02a4d21cdb0048e039e285..0f6a61321435a8ef583eba9caab80777286c5aa0 100644 (file)
@@ -1072,9 +1072,6 @@ void Objecter::C_Linger_Map_Latest::finish(int r)
 
   LingerOp *op = iter->second;
   objecter->check_latest_map_lingers.erase(iter);
-  assert(op->get_nref() > 1);  // something other than check_latest_map_lingers should
-                               // have a ref to this guy too
-  op->put();
 
   if (op->map_dne_bound == 0)
     op->map_dne_bound = latest;
@@ -1085,6 +1082,8 @@ void Objecter::C_Linger_Map_Latest::finish(int r)
   if (unregister) {
     objecter->_unregister_linger(op->linger_id);
   }
+
+  op->put();
 }
 
 void Objecter::_check_linger_pool_dne(LingerOp *op, bool *need_unregister)
@@ -1155,12 +1154,13 @@ void Objecter::C_Command_Map_Latest::finish(int r)
 
   CommandOp *c = iter->second;
   objecter->check_latest_map_commands.erase(iter);
-  c->put();
 
   if (c->map_dne_bound == 0)
     c->map_dne_bound = latest;
 
   objecter->_check_command_map_dne(c);
+
+  c->put();
 }
 
 void Objecter::_check_command_map_dne(CommandOp *c)