Kernel: Fix .. directory entry at mount point handling a little

It's still broken, but at least it now appears to work if the file system
doesn't return the same inode for "..".
This commit is contained in:
Sergey Bugaev 2020-07-02 12:46:07 +03:00 committed by Andreas Kling
parent 3645b9e2a6
commit 0c72a9eda7
Notes: sideshowbarker 2024-07-19 05:10:04 +09:00

View File

@ -203,7 +203,7 @@ void VFS::traverse_directory_inode(Inode& dir_inode, Function<bool(const FS::Dir
// FIXME: This is now broken considering chroot and bind mounts.
bool is_root_inode = dir_inode.identifier() == dir_inode.fs().root_inode()->identifier();
if (is_root_inode && !is_vfs_root(dir_inode.identifier()) && !strcmp(entry.name, "..")) {
auto mount = find_mount_for_guest(entry.inode);
auto mount = find_mount_for_guest(dir_inode);
ASSERT(mount);
ASSERT(mount->host());
resolved_inode = mount->host()->identifier();