}
}
} else if (CDir *dir = dynamic_cast<CDir*>(*it)) {
- auto next = it;
- ++next;
+ ++it;
+ bool added_children = false;
bool done = false; // it's done, so pop it off the stack
- scrub_dirfrag(dir, &done);
+ scrub_dirfrag(dir, &added_children, &done);
if (done) {
- dout(20) << __func__ << " dirfrag, done" << dendl;
- ++it; // child inodes were queued at bottom of stack
- dequeue(dir);
- } else {
- it = next;
+ dout(20) << __func__ << " dirfrag, done" << dendl;
+ dequeue(dir);
+ }
+ if (added_children) {
+ it = scrub_stack.begin();
}
} else {
ceph_assert(0 == "dentry in scrub stack");
}
}
-void ScrubStack::scrub_dirfrag(CDir *dir, bool *done)
+void ScrubStack::scrub_dirfrag(CDir *dir, bool *added_children, bool *done)
{
ceph_assert(dir != NULL);
continue;
}
if (dnl->is_primary()) {
- _enqueue(dnl->get_inode(), header, false);
+ *added_children = true;
+ _enqueue(dnl->get_inode(), header, true);
} else if (dnl->is_remote() || dnl->is_referent_remote()) {
identify_remote_link_damage(dn);
}
* scrub of the dirfrag.
*
* @param dir The dirfrag to scrub (must be auth)
+ * @param added_children set to true if we pushed some of our children
* @param done set to true if we started to do final scrub
*/
- void scrub_dirfrag(CDir *dir, bool *done);
+ void scrub_dirfrag(CDir *dir, bool *added_children, bool *done);
/**
* Scrub a directory-representing dentry.
*