From 2d2d28689c506141b263a53738004ae9fdf3bab7 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Mon, 7 Apr 2025 05:31:13 +0000 Subject: [PATCH] fix(kernel/vfs): correct root assignment logic in filesystem --- Kernel/storage/filesystem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Kernel/storage/filesystem.cpp b/Kernel/storage/filesystem.cpp index aa273d1a..766b2596 100644 --- a/Kernel/storage/filesystem.cpp +++ b/Kernel/storage/filesystem.cpp @@ -43,7 +43,6 @@ namespace vfs if (Index >= FileSystemRoots->Children.size()) FileSystemRoots->Children.resize(Index + 1); - FileSystemRoots->Children[Index] = Root; if (FileSystemRoots->Children[Index] == nullptr) FileSystemRoots->Children[Index] = Root; else @@ -56,7 +55,10 @@ namespace vfs assert(Index < FileSystemRoots->Children.size()); if (FileSystemRoots->Children[Index] != nullptr) + { + debug("Root %ld already exists", Index); return false; + } FileSystemRoots->Children[Index] = Root; return true; }