From c6a60d9c73d53029fa14f9453d090df553598770 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 2 Feb 2015 08:37:05 -0800 Subject: [PATCH] ReplicatedPG::do_op: ignore snapset_obc if !exists Fixes: 10717 Signed-off-by: Samuel Just --- src/osd/ReplicatedPG.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index b0b096c272f72..5f230f8d072a2 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1697,6 +1697,14 @@ void ReplicatedPG::do_op(OpRequestRef& op) if (!obc->obs.exists) ctx->snapset_obc = get_object_context(obc->obs.oi.soid.get_snapdir(), false); + /* Due to obc caching, we might have a cached non-existent snapset_obc + * for the snapdir. If so, we can ignore it. Subsequent parts of the + * do_op pipeline make decisions based on whether snapset_obc is + * populated. + */ + if (ctx->snapset_obc && !ctx->snapset_obc->obs.exists) + ctx->snapset_obc = ObjectContextRef(); + if (m->get_flags() & CEPH_OSD_FLAG_SKIPRWLOCKS) { dout(20) << __func__ << ": skipping rw locks" << dendl; } else if (m->get_flags() & CEPH_OSD_FLAG_FLUSH) { -- 2.39.5