continue;
}
+ if (!dn->get_linkage()->is_primary()) {
+ dout(15) << " skip dentry " << dnkey.name
+ << ", no longer primary" << dendl;
+ continue;
+ }
+
*dnout = dn;
return 0;
}
MDSInternalContextBase *f)
{
dout(20) << __func__ << " with scrub_version " << get_version() << dendl;
- assert(!scrub_is_in_progress());
+ if (scrub_is_in_progress()) {
+ dout(20) << __func__ << " inode moved during scrub, reinitializing "
+ << dendl;
+ assert(scrub_infop->scrub_parent);
+ CDentry *dn = scrub_infop->scrub_parent;
+ CDir *dir = dn->dir;
+ dn->put(CDentry::PIN_SCRUBPARENT);
+ assert(dir->scrub_infop && dir->scrub_infop->directory_scrubbing);
+ dir->scrub_infop->directories_scrubbing.erase(dn->key());
+ dir->scrub_infop->others_scrubbing.erase(dn->key());
+ }
scrub_info();
if (!scrub_infop)
scrub_infop = new scrub_info_t();