mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 23:04:59 +00:00
Kernel: Sprinkle some lockers in Inode
It did look pretty suspicious the way we were accessing members in some of these functions without taking the lock first.
This commit is contained in:
parent
34d458d111
commit
1fdd39ff14
3 changed files with 13 additions and 5 deletions
|
@ -297,14 +297,15 @@ KResultOr<NonnullRefPtr<FileDescription>> VFS::open(StringView path, int options
|
|||
return *preopen_fd;
|
||||
|
||||
if (metadata.is_fifo()) {
|
||||
auto fifo = inode.fifo();
|
||||
if (options & O_WRONLY) {
|
||||
auto description = inode.fifo().open_direction_blocking(FIFO::Direction::Writer);
|
||||
auto description = fifo->open_direction_blocking(FIFO::Direction::Writer);
|
||||
description->set_rw_mode(options);
|
||||
description->set_file_flags(options);
|
||||
description->set_original_inode({}, inode);
|
||||
return description;
|
||||
} else if (options & O_RDONLY) {
|
||||
auto description = inode.fifo().open_direction_blocking(FIFO::Direction::Reader);
|
||||
auto description = fifo->open_direction_blocking(FIFO::Direction::Reader);
|
||||
description->set_rw_mode(options);
|
||||
description->set_file_flags(options);
|
||||
description->set_original_inode({}, inode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue