From: Sage Weil Date: Sun, 5 Jan 2014 09:04:16 +0000 (-0800) Subject: osd/ReplicatedPG: adjust flow in process_copy_chunk X-Git-Tag: v0.77~22^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7daab5ac6195f694e9889abfc100798f7db3b6a9;p=ceph.git osd/ReplicatedPG: adjust flow in process_copy_chunk Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 0493e848ce14..64bb63a63e89 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4980,28 +4980,31 @@ void ReplicatedPG::process_copy_chunk(hobject_t oid, tid_t tid, int r) cop->objecter_tid2 = 0; // assume this ordered before us (if it happened) ObjectContextRef& cobc = cop->obc; - if (r >= 0) { - assert(cop->rval >= 0); - - if (!cop->cursor.is_complete()) { - // write out what we have so far - ObjectContextRef tempobc = get_object_context(cop->temp_oid, true); - RepGather *repop = simple_repop_create(tempobc); - if (cop->temp_cursor.is_initial()) { - cop->temp_coll = get_temp_coll(&repop->ctx->local_t); - repop->ctx->new_temp_oid = cop->temp_oid; - } - _write_copy_chunk(cop, &repop->ctx->op_t); - simple_repop_submit(repop); - - dout(10) << __func__ << " fetching more" << dendl; - _copy_some(cobc, cop); - return; - } - _build_finish_copy_transaction(cop, cop->results.final_tx); + if (r < 0) + goto out; + + assert(cop->rval >= 0); + + if (!cop->cursor.is_complete()) { + // write out what we have so far + ObjectContextRef tempobc = get_object_context(cop->temp_oid, true); + RepGather *repop = simple_repop_create(tempobc); + if (cop->temp_cursor.is_initial()) { + cop->temp_coll = get_temp_coll(&repop->ctx->local_t); + repop->ctx->new_temp_oid = cop->temp_oid; + } + _write_copy_chunk(cop, &repop->ctx->op_t); + simple_repop_submit(repop); + dout(10) << __func__ << " fetching more" << dendl; + _copy_some(cobc, cop); + return; } - dout(20) << __func__ << " complete; committing" << dendl; + dout(20) << __func__ << " success; committing" << dendl; + _build_finish_copy_transaction(cop, cop->results.final_tx); + + out: + dout(20) << __func__ << " complete r = " << cpp_strerror(r) << dendl; CopyCallbackResults results(r, &cop->results); cop->cb->complete(results);