mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 19:38:12 +00:00
Kernel: Add missing error check when opening root file system
This commit is contained in:
parent
b02eb8224c
commit
4b3bc3805b
1 changed files with 7 additions and 3 deletions
|
@ -182,11 +182,15 @@ NonnullRefPtr<FileSystem> StorageManagement::root_filesystem() const
|
||||||
if (!boot_device_description) {
|
if (!boot_device_description) {
|
||||||
PANIC("StorageManagement: Couldn't find a suitable device to boot from");
|
PANIC("StorageManagement: Couldn't find a suitable device to boot from");
|
||||||
}
|
}
|
||||||
auto e2fs = Ext2FS::create(FileDescription::try_create(boot_device_description.release_nonnull()).value());
|
auto description_or_error = FileDescription::try_create(boot_device_description.release_nonnull());
|
||||||
if (auto result = e2fs->initialize(); result.is_error()) {
|
VERIFY(!description_or_error.is_error());
|
||||||
|
|
||||||
|
auto file_system = Ext2FS::create(description_or_error.release_value());
|
||||||
|
|
||||||
|
if (auto result = file_system->initialize(); result.is_error()) {
|
||||||
PANIC("StorageManagement: Couldn't open root filesystem: {}", result);
|
PANIC("StorageManagement: Couldn't open root filesystem: {}", result);
|
||||||
}
|
}
|
||||||
return e2fs;
|
return file_system;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StorageManagement::initialized()
|
bool StorageManagement::initialized()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue