From: Samuel Just Date: Wed, 2 Apr 2014 17:11:02 +0000 (-0700) Subject: ReplicatedPG::_scrub: don't bail early for snapdir X-Git-Tag: v0.79~21^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=01445d5c623d0628e66a252a22733de25bc4d70e;p=ceph.git ReplicatedPG::_scrub: don't bail early for snapdir Fixes: #7937 Signed-off-by: Samuel Just --- diff --git a/src/common/hobject.h b/src/common/hobject.h index 293348356bbc..fc12c9f1c457 100644 --- a/src/common/hobject.h +++ b/src/common/hobject.h @@ -102,6 +102,11 @@ public: return ret; } + /// @return true if object is snapdir + bool is_snapdir() const { + return snap == CEPH_SNAPDIR; + } + /// @return true if object is head bool is_head() const { return snap == CEPH_NOSNAP; diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 8daeef90efda..23012e83b65b 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -11109,11 +11109,6 @@ void ReplicatedPG::_scrub(ScrubMap& scrubmap) } } } - if (soid.snap == CEPH_SNAPDIR) { - string cat; - scrub_cstat.add(stat, cat); - continue; - } // basic checks. if (p->second.attrs.count(OI_ATTR) == 0) { @@ -11140,10 +11135,12 @@ void ReplicatedPG::_scrub(ScrubMap& scrubmap) stat.num_bytes += oi.size; - if (oi.is_dirty()) - ++stat.num_objects_dirty; - if (oi.is_whiteout()) - ++stat.num_whiteouts; + if (!soid.is_snapdir()) { + if (oi.is_dirty()) + ++stat.num_objects_dirty; + if (oi.is_whiteout()) + ++stat.num_whiteouts; + } //bufferlist data; //osd->store->read(c, poid, 0, 0, data);