]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: Also count overlaps for snapsets on snapdirs
authorSamuel Just <samuel.just@dreamhost.com>
Wed, 23 Nov 2011 22:05:29 +0000 (14:05 -0800)
committerSamuel Just <samuel.just@dreamhost.com>
Wed, 23 Nov 2011 22:07:54 +0000 (14:07 -0800)
Previously, the overlaps for snapdirs would not be included in
cstat causing the computed total to be incorrect.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
src/osd/ReplicatedPG.cc

index 60c6095c4e312bd4dbc73791b412e5b0dd30e49e..a04418902b2e132d89fd81d34d475383040fb7f0 100644 (file)
@@ -5226,7 +5226,8 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed)
        p++) {
     const hobject_t& soid = p->first;
     object_stat_sum_t stat;
-    stat.num_objects++;
+    if (soid.snap != CEPH_SNAPDIR)
+      stat.num_objects++;
 
     // new snapset?
     if (soid.snap == CEPH_SNAPDIR ||
@@ -5267,8 +5268,11 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed)
        }         
       }
     }
-    if (soid.snap == CEPH_SNAPDIR)
+    if (soid.snap == CEPH_SNAPDIR) {
+      string cat;
+      cstat.add(stat, cat);
       continue;
+    }
 
     // basic checks.
     if (p->second.attrs.count(OI_ATTR) == 0) {