diff options
author | Liav A <liavalb@gmail.com> | 2022-08-20 09:28:02 +0300 |
---|---|---|
committer | Andrew Kaster <andrewdkaster@gmail.com> | 2022-10-22 16:57:52 -0400 |
commit | fea3cb5ff9127d2f5524d8923157c5281d6b8340 (patch) | |
tree | 380041e77cce7ec4642f1d4ff999ca68cbc9db5b /Base | |
parent | 24977996a693a05607c8f8788c94d6719a3dbad9 (diff) | |
download | serenity-fea3cb5ff9127d2f5524d8923157c5281d6b8340.zip |
Kernel/FileSystem: Discard safely filesystems when unmounted last time
This commit reached that goal of "safely discarding" a filesystem by
doing the following:
1. Stop using the s_file_system_map HashMap as it was an unsafe measure
to access pointers of FileSystems. Instead, make sure to register all
FileSystems at the VFS layer, with an IntrusiveList, to avoid problems
related to OOM conditions.
2. Make sure to cleanly remove the DiskCache object from a BlockBased
filesystem, so the destructor of such object will not need to do that in
the destruction point.
3. For ext2 filesystems, don't cache the root inode at m_inode_cache
HashMap. The reason for this is that when unmounting an ext2 filesystem,
we lookup at the cache to see if there's a reference to a cached inode
and if that's the case, we fail with EBUSY. If we keep the m_root_inode
also being referenced at the m_inode_cache map, we have 2 references to
that object, which will lead to fail with EBUSY. Also, it's much simpler
to always ask for a root inode and get it immediately from m_root_inode,
instead of looking up the cache for that inode.
Diffstat (limited to 'Base')
0 files changed, 0 insertions, 0 deletions