From: Sage Weil Date: Tue, 1 Apr 2014 18:04:47 +0000 (-0700) Subject: osd/ReplicatedPG: handle snapdir properly during scrub X-Git-Tag: v0.79~21^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c2e5a428744d5dd36d765317fb78da4633601e5c;p=ceph.git osd/ReplicatedPG: handle snapdir properly during scrub Handle snapdir similarly to how head is treated when updating the next_clone info. Also, add a warning when we have a snapdir object and head_exists == true (the converse of the existing check). Fixes: #7937 Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 27528c846430..226ff43e81e6 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -11176,10 +11176,16 @@ void ReplicatedPG::_scrub(ScrubMap& scrubmap) ++scrubber.shallow_errors; } - if (soid.snap == CEPH_NOSNAP) { - if (!snapset.head_exists) { + if (soid.snap == CEPH_NOSNAP || soid.snap == CEPH_SNAPDIR) { + if (soid.snap == CEPH_NOSNAP && !snapset.head_exists) { + osd->clog.error() << mode << " " << info.pgid << " " << soid + << " snapset.head_exists=false, but head exists"; + ++scrubber.shallow_errors; + continue; + } + if (soid.snap == CEPH_SNAPDIR && snapset.head_exists) { osd->clog.error() << mode << " " << info.pgid << " " << soid - << " snapset.head_exists=false, but object exists"; + << " snapset.head_exists=true, but snapdir exists"; ++scrubber.shallow_errors; continue; }