Skip to content

Commit

Permalink
ReplicatedPG::_scrub: don't bail early for snapdir
Browse files Browse the repository at this point in the history
Fixes: ceph#7937
Signed-off-by: Samuel Just <[email protected]>
  • Loading branch information
Samuel Just committed Apr 2, 2014
1 parent dde1c91 commit 01445d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
5 changes: 5 additions & 0 deletions src/common/hobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ struct hobject_t {
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;
Expand Down
15 changes: 6 additions & 9 deletions src/osd/ReplicatedPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 01445d5

Please sign in to comment.