From ba998f05b7d9ff246dcd0977da922cacc4ddb42b Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 25 Jan 2011 13:58:36 -0800 Subject: [PATCH] ReplicatedPG: _rollback_to fix the just cloned condition _rollback_to in the case that head was just cloned and that clone includes snapid does not need to do anything. Previously, snapid would have to match the snap on the clone, but the condition should be that snapid is contained within the clone's snaps set. This bug was introduced in e189222f06ee287eeb6fd7f46cff7a6727806dea Signed-off-by: Samuel Just --- src/osd/ReplicatedPG.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 4aa34ce56ce95..5f8567f75121a 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1656,10 +1656,8 @@ void ReplicatedPG::_rollback_to(OpContext *ctx, ceph_osd_op& op) } } else { //we got our context, let's use it to do the rollback! sobject_t& rollback_to_sobject = rollback_to->obs.oi.soid; - if (ctx->clone_obc && - (ctx->clone_obc->obs.oi.soid.snap == snapid)) { + if (ctx->clone_obc && *ctx->clone_obc->obs.oi.snaps.rbegin() <= snapid) { //just cloned the rollback target, we don't need to do anything! - } else { /* 1) Delete current head * 2) Clone correct snapshot into head -- 2.39.5