BFS: Fix vising attribute runs in FileSystemVisitor.

See inline comment. Fixes "vnode refcount > 0" assert failures while
running checkfs after yesterday's commits.
This commit is contained in:
Augustin Cavalier 2019-02-20 11:24:15 -05:00
parent 13c4bc94ca
commit b08b51b417

View File

@ -163,6 +163,12 @@ FileSystemVisitor::Next()
if ((fFlags & VISIT_ATTRIBUTE_DIRECTORIES)
&& !inode->Attributes().IsZero()) {
fStack.Push(inode->Attributes());
// We may already be keeping the associated Vnode, so we can't
// just call vnode.Keep() here, but rather acquire another reference
// to it specifically.
Vnode attrNode(fVolume, inode->Attributes());
attrNode.Keep();
}
bool visitingCurrentDirectory = inode->BlockRun() == fCurrent;