From: Samuel Just Date: Tue, 19 May 2015 17:56:11 +0000 (-0700) Subject: ReplicatedPG::finish_ctx: take excl lock if operation is rw X-Git-Tag: v9.0.2~90^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5c2b795724423ed484ab451de855ddcfc085342b;p=ceph.git ReplicatedPG::finish_ctx: take excl lock if operation is rw Fixes: #11677 Signed-off-by: Samuel Just --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 4c549a5fd3d3..f037cd53bc24 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5741,7 +5741,13 @@ void ReplicatedPG::finish_ctx(OpContext *ctx, int log_op_type, bool maintain_ssc if (!ctx->snapset_obc) ctx->snapset_obc = get_object_context(snapoid, true); - bool got = ctx->snapset_obc->get_write_greedy(ctx->op); + bool got = false; + if (ctx->lock_to_release == OpContext::W_LOCK) { + got = ctx->snapset_obc->get_write_greedy(ctx->op); + } else { + assert(ctx->lock_to_release == OpContext::E_LOCK); + got = ctx->snapset_obc->get_excl(ctx->op); + } assert(got); dout(20) << " got greedy write on snapset_obc " << *ctx->snapset_obc << dendl; ctx->release_snapset_obc = true;