From: Samuel Just Date: Tue, 12 Aug 2014 23:41:38 +0000 (-0700) Subject: ReplicatedPG::cancel_copy: clear cop->obc X-Git-Tag: v0.80.6~32 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=21e1faa75da4e9cab8e139a8e2a1c4fc0ee30867;p=ceph.git ReplicatedPG::cancel_copy: clear cop->obc Otherwise, an objecter callback might still be hanging onto this reference until after the flush. Fixes: #8894 Introduced: 589b639af7c8834a1e6293d58d77a9c440107bc3 Signed-off-by: Samuel Just (cherry picked from commit 5040413054e923d6d5a2b4928162dba140d980e0) --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 155c322a55dfa..604a57f0a32a8 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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)