]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix leak of src_obc references
authorSage Weil <sage.weil@dreamhost.com>
Wed, 28 Sep 2011 04:28:27 +0000 (21:28 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Wed, 28 Sep 2011 04:28:27 +0000 (21:28 -0700)
We never moved the src_obc map from the local var into the RepGather
member!

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/ReplicatedPG.cc

index 0219f62edb9bace3c0dc534613831c777d930a9e..2bf5f26f2b8739be8cb0843d103502748830934e 100644 (file)
@@ -669,6 +669,8 @@ void ReplicatedPG::do_op(MOSDOp *op)
   RepGather *repop = new_repop(ctx, obc, rep_tid);  // new repop claims our obc, src_obc refs
   // note: repop now owns ctx AND ctx->op
 
+  repop->src_obc.swap(src_obc); // and src_obc.
+
   issue_repop(repop, now, old_last_update, old_exists, old_size, old_version);
 
   eval_repop(repop);
@@ -3256,6 +3258,9 @@ void ReplicatedPG::put_object_context(ObjectContext *obc)
 
 void ReplicatedPG::put_object_contexts(map<hobject_t,ObjectContext*>& obcv)
 {
+  if (obcv.empty())
+    return;
+  dout(10) << "put_object_contexts " << obcv << dendl;
   for (map<hobject_t,ObjectContext*>::iterator p = obcv.begin(); p != obcv.end(); ++p)
     put_object_context(p->second);
   obcv.clear();