Take into account that we may look up "." or ".." and we must obviously not set

the parent directory in those cases. Also, when updating the parent directory
we need to update the ".." dirent if we already populated it with a different
value before.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32823 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2009-08-30 00:02:44 +00:00
parent da249e74e9
commit fbaa0b510d
@@ -286,6 +286,8 @@ void
OverlayInode::SetParentDir(OverlayInode *parentDir)
{
fParentDir = parentDir;
if (fHasDirents && fDirentCount >= 2)
fDirents[1]->inode_number = parentDir->InodeNumber();
}
@@ -318,7 +320,7 @@ OverlayInode::Lookup(const char *name, ino_t *inodeNumber)
OverlayInode *node = NULL;
status_t result = get_vnode(Volume(), *inodeNumber,
(void **)&node);
if (result == B_OK && node != NULL)
if (result == B_OK && node != NULL && i >= 2)
node->SetParentDir(this);
return result;
}