]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: don't count SNAPDIR as a clone during backfill
authorSage Weil <sage.weil@dreamhost.com>
Mon, 20 Feb 2012 17:40:03 +0000 (09:40 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Mon, 20 Feb 2012 17:40:03 +0000 (09:40 -0800)
When we are backfilling, we add in objects as we push them.  Do not count
the snapdir object as a clone, or else we'll screw up the count.

Fixes: #2080
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/ReplicatedPG.cc

index 89950d1f8308cf1ca65ae0de4848ea06220faad0..80a2da15260786d86bbcfefcca5bd41c2f7ead01 100644 (file)
@@ -3534,12 +3534,12 @@ void ReplicatedPG::add_object_context_to_pg_stat(ObjectContext *obc, pg_stat_t *
   dout(10) << "add_object_context_to_pg_stat " << oi.soid << dendl;
   object_stat_sum_t stat;
 
+  stat.num_bytes += oi.size;
+
   if (oi.soid.snap != CEPH_SNAPDIR)
     stat.num_objects++;
 
-  stat.num_bytes += oi.size;
-
-  if (oi.soid.snap && oi.soid.snap != CEPH_NOSNAP) {
+  if (oi.soid.snap && oi.soid.snap != CEPH_NOSNAP && oi.soid.snap != CEPH_SNAPDIR) {
     stat.num_object_clones++;
 
     if (!obc->ssc)