]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG.cc:
authorSamuel Just <samuelj@hq.newdream.net>
Wed, 15 Dec 2010 20:57:10 +0000 (12:57 -0800)
committerSamuel Just <samuelj@hq.newdream.net>
Thu, 16 Dec 2010 01:23:59 +0000 (17:23 -0800)
_scrub must set head when it encounters a head snap
curclone counts down, not up

Signed-off-by: Samuel Just <samuelj@hq.newdream.net>
src/osd/ReplicatedPG.cc

index 7e6a1e1b71c679cb8406bb2a4a45a18a83fbf019..df2b756752de89541620f90f6e8bc8a4579b1183 100644 (file)
@@ -4020,8 +4020,10 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed)
       // what will be next?
       if (snapset.clones.empty())
        head = sobject_t();  // no clones.
-      else
+      else {
        curclone = snapset.clones.size()-1;
+       head = p->first;
+      }
 
       // subtract off any clone overlap
       for (map<snapid_t,interval_set<uint64_t> >::iterator q = snapset.clone_overlap.begin();
@@ -4077,9 +4079,10 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed)
       // ...
 
       // what's next?
-      curclone++;
-      if (curclone == snapset.clones.size())
+      if (curclone == 0)
        head = sobject_t();
+      else
+       curclone--;
 
     } else {
       // it's unversioned.