mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-03 13:14:45 +00:00
vfs: tolerate fs construction failures
When trying to apply dynamic config updates to the VFS, don't rely on the assumption that one file-system instance exists for each XML node because a malconfigured file-system route may result in a skipped file-system construction. Print a diagnostic message instead. Encountered while working on issue #5445
This commit is contained in:
parent
0174e24f5c
commit
b6cd11abc8
@ -872,10 +872,15 @@ class Vfs::Dir_file_system : public File_system
|
||||
for (unsigned i = 0; i < node.num_sub_nodes(); i++, curr = curr->next) {
|
||||
Xml_node const &sub_node = node.sub_node(i);
|
||||
|
||||
if (!curr) {
|
||||
error("VFS config update missed file system for ", sub_node);
|
||||
return;
|
||||
}
|
||||
|
||||
/* check if type of XML node matches current file-system type */
|
||||
if (sub_node.has_type(curr->type()) == false) {
|
||||
Genode::error("VFS config update failed (node type '",
|
||||
sub_node.type(), "' != fs type '", curr->type(),"')");
|
||||
if (!curr || sub_node.has_type(curr->type()) == false) {
|
||||
error("VFS config update failed (node type '",
|
||||
sub_node.type(), "' != fs type '", curr->type(),"')");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user