From 300b5e8ecbb7526b55e2cb5eeba81fd501a8b652 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 12 Aug 2014 12:20:28 -0700 Subject: [PATCH] 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 --- src/osd/ReplicatedPG.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 7feb2d843d30a..55eb1195a4591 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)); -- 2.39.5