]> 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>
Tue, 26 Aug 2014 20:10:48 +0000 (13:10 -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>
(cherry picked from commit 5040413054e923d6d5a2b4928162dba140d980e0)

src/osd/ReplicatedPG.cc

index 155c322a55dfaf0bb127aad7568eccf2051d2d9a..604a57f0a32a8e3606e349d0cec06c53f9edc0a6 100644 (file)
@@ -6035,6 +6035,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)