mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:28:12 +00:00
Kernel: Make Ext2FSInode::traverse_as_directory to take m_inode_lock
The contents of the directory inode could change if we are not taking so we must take the m_inode_lock to prevent corruption when reading the directory contents.
This commit is contained in:
parent
46ef2f8e20
commit
2ab657d3b5
1 changed files with 1 additions and 0 deletions
|
@ -728,6 +728,7 @@ ErrorOr<size_t> Ext2FSInode::write_bytes_locked(off_t offset, size_t count, User
|
||||||
|
|
||||||
ErrorOr<void> Ext2FSInode::traverse_as_directory(Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)> callback) const
|
ErrorOr<void> Ext2FSInode::traverse_as_directory(Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)> callback) const
|
||||||
{
|
{
|
||||||
|
MutexLocker locker(m_inode_lock);
|
||||||
VERIFY(is_directory());
|
VERIFY(is_directory());
|
||||||
|
|
||||||
u8 buffer[max_block_size];
|
u8 buffer[max_block_size];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue