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: v0.94.3~62^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c7b6a6370a69149ea94f9e35d536aa90f06e7659;p=ceph.git ReplicatedPG::finish_ctx: take excl lock if operation is rw Fixes: #11677 Signed-off-by: Samuel Just (cherry picked from commit 5c2b795724423ed484ab451de855ddcfc085342b) --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 37b2f51ad820..ce7a5dfb1f0d 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5711,7 +5711,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;