From 93cf4f8bea5b5b09faa2cd11f39addf747cf6208 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Wed, 28 Aug 2019 14:38:42 +0800 Subject: [PATCH] osd/PrimaryLogPG: block obc for any inflight manifest ops otherwise it is likely to race with any follow-up scrubbing activities. Note that it's ok for us to requeue_scrub before re-executing the op since scrubbing will be blocking for the (same) global pg lock we are currently holding. Fixes: https://tracker.ceph.com/issues/41427 Signed-off-by: xie xingguo --- src/osd/PrimaryLogPG.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index eb8cf358668..c1a6b4b7689 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -3182,6 +3182,8 @@ public: : ctx(ctx), osd_op(osd_op) {} void finish(int r) override { // NB: caller must already have pg->lock held + ctx->obc->stop_block(); + ctx->pg->kick_object_context_blocked(ctx->obc); if (r >= 0) { osd_op.rval = 0; ctx->pg->execute_ctx(ctx); @@ -3287,6 +3289,7 @@ void PrimaryLogPG::refcount_manifest(ObjectContextRef obc, object_locator_t oloc flags, c); if (cb) { manifest_ops[obc->obs.oi.soid] = std::make_shared(cb, tid); + obc->start_block(); } } -- 2.39.5