From: Jianpeng Ma Date: Fri, 20 Mar 2015 05:33:13 +0000 (+0800) Subject: osd/ReplicatedPG: Don't create objectcontext when remove tmp-obj for promote failed... X-Git-Tag: v9.0.3~57^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=75465eb7b3f4e63afce4e0b337b2a8edbed725ef;p=ceph.git osd/ReplicatedPG: Don't create objectcontext when remove tmp-obj for promote failed if there was has tmp-obj. If on objectcontext for tmp-obj dosen't find, there must be a bug. Signed-off-by: Jianpeng Ma --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 4b12bb9ba3b..7bcce73ecaa 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6611,7 +6611,8 @@ void ReplicatedPG::finish_promote(int r, CopyResults *results, if (r < 0 && results->started_temp_obj) { dout(10) << __func__ << " abort; will clean up partial work" << dendl; - ObjectContextRef tempobc = get_object_context(results->temp_oid, true); + ObjectContextRef tempobc = get_object_context(results->temp_oid, false); + assert(tempobc); RepGather *repop = simple_repop_create(tempobc); repop->ctx->op_t->remove(results->temp_oid); simple_repop_submit(repop);