From d687ed96fd1f125195a537bf93b6919679061a75 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 10 Feb 2014 18:34:52 -0800 Subject: [PATCH] ReplicatedPG: take clone write lock as well in make_writeable Otherwise, we might start backfilling the clone before the op is complete. Signed-off-by: Samuel Just --- src/osd/ReplicatedPG.cc | 2 ++ src/osd/ReplicatedPG.h | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 31e31c72dbc..3c2372676be 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4622,6 +4622,8 @@ void ReplicatedPG::make_writeable(OpContext *ctx) if (pool.info.require_rollback()) ctx->clone_obc->attr_cache = ctx->obc->attr_cache; snap_oi = &ctx->clone_obc->obs.oi; + bool got = ctx->clone_obc->get_write(ctx->op); + assert(got); } else { snap_oi = &static_snap_oi; } diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 0564395fbab..474f020bf6b 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -629,10 +629,13 @@ protected: void release_op_ctx_locks(OpContext *ctx) { list to_req; bool requeue_recovery = false; + bool requeue_recovery_clone = false; switch (ctx->lock_to_release) { case OpContext::W_LOCK: ctx->obc->put_write(&to_req, &requeue_recovery); - if (requeue_recovery) + if (ctx->clone_obc) + ctx->clone_obc->put_write(&to_req, &requeue_recovery_clone); + if (requeue_recovery || requeue_recovery_clone) osd->recovery_wq.queue(this); break; case OpContext::R_LOCK: