results->backtrace.error_str << "failed to read off disk; see retval";
// we probably have a new unwritten file!
// so skip the backtrace scrub for this entry and say that all's well
- if (in->is_dirty_parent())
+ if (in->is_dirty_parent()) {
+ dout(20) << "forcing backtrace as passed since inode is dirty parent" << dendl;
results->backtrace.passed = true;
+ }
goto next;
}
<< bl.length() << " bytes)!";
// we probably have a new unwritten file!
// so skip the backtrace scrub for this entry and say that all's well
- if (in->is_dirty_parent())
+ if (in->is_dirty_parent()) {
+ dout(20) << "decode failed; forcing backtrace as passed since "
+ "inode is dirty parent" << dendl;
results->backtrace.passed = true;
+ }
goto next;
}
if (divergent || memory_newer < 0) {
// we're divergent, or on-disk version is newer
results->backtrace.error_str << "On-disk backtrace is divergent or newer";
- // we probably have a new unwritten file!
- // so skip the backtrace scrub for this entry and say that all's well
- if (divergent && in->is_dirty_parent())
+ /* if the backtraces are divergent and the link count is 0, then
+ * most likely its a stray entry that's being purged and things are
+ * well and there's no reason for alarm
+ */
+ if (divergent && (in->is_dirty_parent() || in->get_inode()->nlink == 0)) {
results->backtrace.passed = true;
+ dout(20) << "divergent backtraces are acceptable when dn "
+ "is being purged or has been renamed or moved to a "
+ "different directory " << *in << dendl;
+ }
} else {
results->backtrace.passed = true;
}
results->raw_stats.error_str
<< "freshly-calculated rstats don't match existing ones";
}
+ if (in->is_dirty()) {
+ MDCache *mdcache = in->mdcache; // for dout()
+ auto ino = [this]() { return in->ino(); }; // for dout()
+ dout(20) << "raw stats most likely wont match since inode is dirty; "
+ "please rerun scrub when system is stable; "
+ "assuming passed for now;" << dendl;
+ results->raw_stats.passed = true;
+ }
goto next;
}
results->raw_stats.passed = true;
+ {
+ MDCache *mdcache = in->mdcache; // for dout()
+ auto ino = [this]() { return in->ino(); }; // for dout()
+ dout(20) << "raw stats check passed on " << *in << dendl;
+ }
+
next:
return true;
}
f->dump_int("read_ret_val", raw_stats.ondisk_read_retval);
f->dump_stream("ondisk_value.dirstat") << raw_stats.ondisk_value.dirstat;
f->dump_stream("ondisk_value.rstat") << raw_stats.ondisk_value.rstat;
- f->dump_stream("memory_value.dirrstat") << raw_stats.memory_value.dirstat;
+ f->dump_stream("memory_value.dirstat") << raw_stats.memory_value.dirstat;
f->dump_stream("memory_value.rstat") << raw_stats.memory_value.rstat;
f->dump_string("error_str", raw_stats.error_str.str());
}