From c4442d70ed75690be1ed73d4931fbbdae9dfa92e Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 24 Oct 2013 18:52:59 -0700 Subject: [PATCH] ReplicatedPG: reset new_obs and new_snapset in execute_ctx This way, if execute_ctx is rerun on the same OpContext, we won't erroneously reuse a stale snapset/object_info. Signed-off-by: Samuel Just --- src/osd/ReplicatedPG.cc | 1 + src/osd/ReplicatedPG.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 450b377288fb2..fc9ce53d27d0c 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1203,6 +1203,7 @@ void ReplicatedPG::do_cache_redirect(OpRequestRef op, ObjectContextRef obc) void ReplicatedPG::execute_ctx(OpContext *ctx) { dout(10) << __func__ << " " << ctx << dendl; + ctx->reset_obs(ctx->obc); OpRequestRef op = ctx->op; MOSDOp *m = static_cast(op->get_req()); ObjectContextRef obc = ctx->obc; diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index f36138079a0b5..e897925f091be 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -403,6 +403,13 @@ public: snapset = &_ssc->snapset; } } + void reset_obs(ObjectContextRef obc) { + new_obs = ObjectState(obc->obs.oi, obc->obs.exists); + if (obc->ssc) { + new_snapset = obc->ssc->snapset; + snapset = &obc->ssc->snapset; + } + } ~OpContext() { assert(!clone_obc); assert(lock_to_release == NONE); -- 2.39.5