]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG::cancel_copy: clear cop->obc
authorSamuel Just <sam.just@inktank.com>
Tue, 12 Aug 2014 23:41:38 +0000 (16:41 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 15 Aug 2014 21:04:20 +0000 (14:04 -0700)
Otherwise, an objecter callback might still be hanging
onto this reference until after the flush.

Fixes: #8894
Introduced: 589b639af7c8834a1e6293d58d77a9c440107bc3
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc

index 7feb2d843d30a7791548e4504e68d25628f90192..ed0bba0d96d8aaaffd3febaa5852225a7b36bd4a 100644 (file)
@@ -6071,6 +6071,11 @@ void ReplicatedPG::cancel_copy(CopyOpRef cop, bool requeue)
   cop->results.should_requeue = requeue;
   CopyCallbackResults result(-ECANCELED, &cop->results);
   cop->cb->complete(result);
+
+  // There may still be an objecter callback referencing this copy op.
+  // That callback will not need the obc since it's been canceled, and
+  // we need the obc reference to go away prior to flush.
+  cop->obc = ObjectContextRef();
 }
 
 void ReplicatedPG::cancel_copy_ops(bool requeue)