{
dout(20) << __func__ << dendl;
assert(is_complete());
+ assert(header != nullptr);
// FIXME: weird implicit construction, is someone else meant
// to be calling scrub_info_create first?
dns.erase(dnkey);
if (dn->get_projected_version() < scrub_infop->last_recursive.version &&
- !(scrub_infop->header && scrub_infop->header->force)) {
+ !(scrub_infop->header->force)) {
dout(15) << " skip dentry " << dnkey.name
<< ", no change since last scrub" << dendl;
continue;
scrub_infop->last_scrub_dirty = true;
} else {
scrub_infop->pending_scrub_error = true;
- if (scrub_infop->header &&
- scrub_infop->header->repair)
+ if (scrub_infop->header->repair)
cache->repair_dirfrag_stats(this);
}
return rval;
// Whether we have a tag to apply depends on ScrubHeader (if one is
// present)
- if (in->scrub_infop && in->scrub_infop->header) {
+ if (in->scrub_infop) {
// I'm a non-orphan, so look up my ScrubHeader via my linkage
const std::string &tag = in->scrub_infop->header->tag;
// Rather than using the usual CInode::fetch_backtrace,
++p) {
CDir *dir = in->get_or_open_dirfrag(in->mdcache, *p);
dir->scrub_info();
- if (!dir->scrub_infop->header && in->scrub_infop)
+ if (!dir->scrub_infop->header)
dir->scrub_infop->header = in->scrub_infop->header;
if (dir->is_complete()) {
dir->scrub_local();
if (dir->scrub_infop &&
dir->scrub_infop->pending_scrub_error) {
dir->scrub_infop->pending_scrub_error = false;
- if (dir->scrub_infop->header &&
- dir->scrub_infop->header->repair) {
+ if (dir->scrub_infop->header->repair) {
results->raw_stats.error_str
<< "dirfrag(" << p->first << ") has bad stats (will be fixed); ";
} else {
if (!dir_info.same_sums(in->inode.dirstat) ||
!nest_info.same_sums(in->inode.rstat)) {
if (in->scrub_infop &&
- in->scrub_infop->header &&
in->scrub_infop->header->repair) {
results->raw_stats.error_str
<< "freshly-calculated rstats don't match existing ones (will be fixed)";
*c = scrub_infop->on_finish;
scrub_infop->on_finish = NULL;
- if (scrub_infop->header && scrub_infop->header->origin == this) {
+ if (scrub_infop->header->origin == this) {
// We are at the point that a tagging scrub was initiated
LogChannelRef clog = mdcache->mds->clog;
clog->info() << "scrub complete with tag '" << scrub_infop->header->tag << "'";
ScrubHeaderRef &header = cs->header;
// Cannot scrub same dentry twice at same time
- if (in->scrub_info()->scrub_in_progress) {
+ if (in->scrub_infop && in->scrub_infop->scrub_in_progress) {
mds->server->respond_to_request(mdr, -EBUSY);
return;
+ } else {
+ in->scrub_info();
}
header->origin = in;