vfs: replace assertion with a check

This commit is contained in:
Mark Poliakov 2025-01-02 21:30:16 +02:00
parent 595504b371
commit f1f7b753d8

View File

@ -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());