aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Oesch <lukasoesch20@gmail.com>2026-03-26 21:15:40 +0100
committerLukas Oesch <lukasoesch20@gmail.com>2026-03-26 21:19:36 +0100
commitc3e80174faa2db9e6674af995aaa95b59ec53fec (patch)
treef8b2e99491c47b35bb6cc19fb6714c377fde0805
parent372148a1379d7f14cbe641272f8f28766925f3aa (diff)
downloadteachos-c3e80174faa2db9e6674af995aaa95b59ec53fec.tar.xz
teachos-c3e80174faa2db9e6674af995aaa95b59ec53fec.zip
fix resolve_path -> first traverse rootfs before jumping into the mounted root filesystem
-rw-r--r--kernel/src/filesystem/vfs.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/kernel/src/filesystem/vfs.cpp b/kernel/src/filesystem/vfs.cpp
index 368d994..40c97f8 100644
--- a/kernel/src/filesystem/vfs.cpp
+++ b/kernel/src/filesystem/vfs.cpp
@@ -139,16 +139,6 @@ namespace filesystem
auto current_dentry = root_mount->root_dentry();
auto current_fs = root_mount->get_filesystem();
- // TODO BA-FS26 use while to allow stacked mounts?
- if (current_dentry->has_flag(dentry::dentry_flags::dcache_mounted))
- {
- auto mnt = m_mount_table.find_mount_by_dentry(current_dentry);
- if (!mnt)
- kapi::system::panic("[FILESYSTEM] dcache_mounted set but no covering mount found.");
- current_dentry = mnt->root_dentry();
- current_fs = mnt->get_filesystem();
- }
-
auto path_parts =
std::views::split(path, '/') | std::views::filter([](auto const & part) { return !part.empty(); });
for (auto const & part : path_parts)
@@ -173,6 +163,8 @@ namespace filesystem
if (next_dentry->has_flag(dentry::dentry_flags::dcache_mounted))
{
auto found_mount = m_mount_table.find_mount_by_dentry(next_dentry);
+ if (!found_mount)
+ kapi::system::panic("[FILESYSTEM] dcache_mounted set but no covering mount found.");
current_fs = found_mount->get_filesystem();
current_dentry = found_mount->root_dentry();
}