]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: _rollback_to fix the just cloned condition
authorSamuel Just <samuel.just@dreamhost.com>
Tue, 25 Jan 2011 21:58:36 +0000 (13:58 -0800)
committerSamuel Just <samuel.just@dreamhost.com>
Tue, 25 Jan 2011 22:36:54 +0000 (14:36 -0800)
_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 <samuel.just@dreamhost.com>
src/osd/ReplicatedPG.cc

index 4aa34ce56ce95c6bc2efa79c5e63f865a5955a41..5f8567f75121ae3dcb064744d59b0faffe366bf8 100644 (file)
@@ -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