dir->scrub_infop->pending_scrub_error) {
dir->scrub_infop->pending_scrub_error = false;
if (dir->scrub_infop->header->get_repair()) {
+ results->raw_stats.repaired = true;
results->raw_stats.error_str
<< "dirfrag(" << p->first << ") has bad stats (will be fixed); ";
} else {
results->raw_stats.error_str
<< "freshly-calculated rstats don't match existing ones (will be fixed)";
in->mdcache->repair_inode_stats(in);
+ results->raw_stats.repaired = true;
} else {
results->raw_stats.error_str
<< "freshly-calculated rstats don't match existing ones";
f->close_section(); // results
}
+bool CInode::validated_data::all_damage_repaired() const
+{
+ bool unrepaired =
+ (raw_stats.checked && !raw_stats.passed && !raw_stats.repaired)
+ ||
+ (backtrace.checked && !backtrace.passed && !backtrace.repaired)
+ ||
+ (inode.checked && !inode.passed && !inode.repaired);
+
+ return !unrepaired;
+}
+
void CInode::dump(Formatter *f) const
{
InodeStoreBase::dump(f);
// Inform the cluster log if we found an error
if (!result.passed_validation) {
- clog->warn() << "Scrub error on inode " << in->ino()
- << " (" << path << ") see " << g_conf->name
- << " log and `damage ls` output for details";
+ if (result.all_damage_repaired()) {
+ clog->info() << "Scrub repaired inode " << in->ino()
+ << " (" << path << ")";
+ } else {
+ clog->warn() << "Scrub error on inode " << in->ino()
+ << " (" << path << ") see " << g_conf->name
+ << " log and `damage ls` output for details";
+ }
// Put the verbose JSON output into the MDS log for later inspection
JSONFormatter f;