fix(kernel/vfs): correct root assignment logic in filesystem

This commit is contained in:
EnderIce2 2025-04-07 05:31:13 +00:00
parent d4346202ca
commit 2d2d28689c
Signed by: enderice2
GPG Key ID: FEB6B8A8507BA62E

View File

@ -43,7 +43,6 @@ namespace vfs
if (Index >= FileSystemRoots->Children.size()) if (Index >= FileSystemRoots->Children.size())
FileSystemRoots->Children.resize(Index + 1); FileSystemRoots->Children.resize(Index + 1);
FileSystemRoots->Children[Index] = Root;
if (FileSystemRoots->Children[Index] == nullptr) if (FileSystemRoots->Children[Index] == nullptr)
FileSystemRoots->Children[Index] = Root; FileSystemRoots->Children[Index] = Root;
else else
@ -56,7 +55,10 @@ namespace vfs
assert(Index < FileSystemRoots->Children.size()); assert(Index < FileSystemRoots->Children.size());
if (FileSystemRoots->Children[Index] != nullptr) if (FileSystemRoots->Children[Index] != nullptr)
{
debug("Root %ld already exists", Index);
return false; return false;
}
FileSystemRoots->Children[Index] = Root; FileSystemRoots->Children[Index] = Root;
return true; return true;
} }