From 75465eb7b3f4e63afce4e0b337b2a8edbed725ef Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Fri, 20 Mar 2015 13:33:13 +0800 Subject: [PATCH] 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 --- src/osd/ReplicatedPG.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.47.3