From: Samuel Just Date: Tue, 12 Aug 2014 19:20:28 +0000 (-0700) Subject: ReplicatedPG: do not pass cop into C_Copyfrom X-Git-Tag: v0.84~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=300b5e8ecbb7526b55e2cb5eeba81fd501a8b652;p=ceph.git ReplicatedPG: do not pass cop into C_Copyfrom We do not know when the objecter will finally let go of this Context. Thus, we cannot know whether it will happen before the flush, at which point the object_context held by the cop must have been released. Also, we simply don't need it, process_copy_chunk alrady works in terms of the tid! Fixes: #8894 Reviewed-by: Sage Weil Signed-off-by: Samuel Just --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 7feb2d843d30..55eb1195a459 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5374,11 +5374,9 @@ struct C_Copyfrom : public Context { hobject_t oid; epoch_t last_peering_reset; ceph_tid_t tid; - ReplicatedPG::CopyOpRef cop; - C_Copyfrom(ReplicatedPG *p, hobject_t o, epoch_t lpr, - const ReplicatedPG::CopyOpRef& c) + C_Copyfrom(ReplicatedPG *p, hobject_t o, epoch_t lpr) : pg(p), oid(o), last_peering_reset(lpr), - tid(0), cop(c) + tid(0) {} void finish(int r) { if (r == -ECANCELED) @@ -5625,7 +5623,7 @@ void ReplicatedPG::_copy_some(ObjectContextRef obc, CopyOpRef cop) &cop->rval); C_Copyfrom *fin = new C_Copyfrom(this, obc->obs.oi.soid, - get_last_peering_reset(), cop); + get_last_peering_reset()); gather.set_finisher(new C_OnFinisher(fin, &osd->objecter_finisher));