]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: do not pass cop into C_Copyfrom
authorSamuel Just <sam.just@inktank.com>
Tue, 12 Aug 2014 19:20:28 +0000 (12:20 -0700)
committerSamuel Just <sam.just@inktank.com>
Tue, 12 Aug 2014 23:21:00 +0000 (16:21 -0700)
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 <sage@redhat.com>
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc

index 7feb2d843d30a7791548e4504e68d25628f90192..55eb1195a459184ccf84a84442660ac0af3b1e6e 100644 (file)
@@ -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));