1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00

Kernel: Do the umount() by the guest's root inode identifier

It was previously possible to unmount a filesystem mounted on /mnt by
doing e.g "umount /mnt/some/path".
This commit is contained in:
Andreas Kling 2019-08-17 14:24:50 +02:00
parent c029f39895
commit 5f6b6c1665
3 changed files with 14 additions and 16 deletions

View file

@ -2811,11 +2811,8 @@ int Process::sys$umount(const char* mountpoint)
if (metadata_or_error.is_error())
return metadata_or_error.error();
auto fsid = metadata_or_error.value().inode.fsid();
auto fs = Ext2FS::from_fsid(fsid);
auto ret = VFS::the().unmount(*fs);
return ret;
auto guest_inode_id = metadata_or_error.value().inode;
return VFS::the().unmount(guest_inode_id);
}
ProcessTracer& Process::ensure_tracer()