vfs: replace assertion with a check
This commit is contained in:
parent
595504b371
commit
f1f7b753d8
@ -422,9 +422,11 @@ impl Node {
|
||||
}
|
||||
|
||||
let fs_root = create_fs()?;
|
||||
let mut parent = fs_root.parent.lock();
|
||||
assert!(fs_root.is_directory());
|
||||
assert!(parent.is_none());
|
||||
let mut parent = fs_root.parent.lock();
|
||||
if parent.is_some() {
|
||||
return Err(Error::InvalidOperation);
|
||||
}
|
||||
|
||||
mountpoint.replace(fs_root.clone());
|
||||
parent.replace(self.clone());
|
||||
|
Loading…
x
Reference in New Issue
Block a user