From 095934fe72b3301d06e47f0b22805770da6e84a5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 18 May 2018 09:24:48 -0500 Subject: [PATCH] osd/PrimaryLogPG: fix try_flush_mark_clean write contention case Release ctx *after* we dereference it to queue up the other flush waiters. This was a dumb mistake in the recent fix from 41609ba1b24e5384494c7959494e19302b5a2429 Fixes: http://tracker.ceph.com/issues/24174 Signed-off-by: Sage Weil (cherry picked from commit 6d6cf388b245e21cc78be00d838e8b214b1e9497) --- src/osd/PrimaryLogPG.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 4454f6b90093f..848b2dd12b1a4 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -10013,7 +10013,6 @@ int PrimaryLogPG::try_flush_mark_clean(FlushOpRef fop) } else if (fop->op) { dout(10) << __func__ << " waiting on write lock " << fop->op << " " << fop->dup_ops << dendl; - close_op_ctx(ctx.release()); // fop->op is now waiting on the lock; get fop->dup_ops to wait too. for (auto op : fop->dup_ops) { bool locked = ctx->lock_manager.get_lock_type( @@ -10023,6 +10022,7 @@ int PrimaryLogPG::try_flush_mark_clean(FlushOpRef fop) op); assert(!locked); } + close_op_ctx(ctx.release()); return -EAGAIN; // will retry } else { dout(10) << __func__ << " failed write lock, no op; failing" << dendl; -- 2.39.5