From: Sage Weil Date: Fri, 18 May 2018 14:24:48 +0000 (-0500) Subject: osd/PrimaryLogPG: fix try_flush_mark_clean write contention case X-Git-Tag: v13.2.0~41^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=095934fe72b3301d06e47f0b22805770da6e84a5;p=ceph.git 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) --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 4454f6b90093..848b2dd12b1a 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;