From c2e5a428744d5dd36d765317fb78da4633601e5c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 1 Apr 2014 11:04:47 -0700 Subject: [PATCH] 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 --- src/osd/ReplicatedPG.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 27528c846430e..226ff43e81e66 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; } -- 2.39.5