]> git-server-git.apps.pok.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@newdream.net>
Wed, 28 Sep 2011 19:19:15 +0000 (12:19 -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 0a8261bb6272a283fe4c1f600bbafce2e32b6d31..0a5202d1b19e785a14b6df148003d309cd97109d 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);
@@ -3206,6 +3208,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();