From: Sage Weil Date: Wed, 28 Sep 2011 04:28:27 +0000 (-0700) Subject: osd: fix leak of src_obc references X-Git-Tag: v0.36~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4884f06f09181576a590c6221d04ef5c284bde79;p=ceph.git osd: fix leak of src_obc references We never moved the src_obc map from the local var into the RepGather member! Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 0a8261bb627..0a5202d1b19 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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& obcv) { + if (obcv.empty()) + return; + dout(10) << "put_object_contexts " << obcv << dendl; for (map::iterator p = obcv.begin(); p != obcv.end(); ++p) put_object_context(p->second); obcv.clear();