summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-01-09 16:41:40 -0800
committerSage Weil <sage@inktank.com>2013-01-15 19:25:11 -0800
commit8fb0481391be8eb24468f8916fd094ce7fe6ba03 (patch)
treeb359ff3f74c1824cdb80f7e83502ba0002f1fe1c
parent4affecee236b84fb1340b3cccfe82c627320200f (diff)
downloadceph-8fb0481391be8eb24468f8916fd094ce7fe6ba03.tar.gz
ReplicatedPG: compare nlinks to snapcolls
nlinks gives us the number of hardlinks to the object. nlinks should be 1 + snapcolls.size(). This will allow us to detect links which remain in an erroneous snap collection. Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/ReplicatedPG.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index f0fd24e4640..8b24fc93b96 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -6672,6 +6672,12 @@ bool ReplicatedPG::_report_snap_collection_errors(
<< std::endl;
errors = true;
}
+ if (nlinks != snapcolls.size() + 1) {
+ out << info.pgid << " osd." << osd << " unaccounted for links on object "
+ << hoid << " snapcolls " << snapcolls << " nlinks " << nlinks
+ << std::endl;
+ errors = true;
+ }
return errors;
}