From 5040413054e923d6d5a2b4928162dba140d980e0 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 12 Aug 2014 16:41:38 -0700 Subject: [PATCH] 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 --- src/osd/ReplicatedPG.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 7feb2d843d30a..ed0bba0d96d8a 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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) -- 2.39.5