From 23822febd2fa62177b16aa720059bb5cdb88cb68 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 7 Mar 2022 21:26:15 +0100 Subject: [PATCH] Kernel: Mark sys$fchdir() as not needing the big lock This syscall doesn't access any data that was implicitly protected by the big lock. --- Kernel/API/Syscall.h | 2 +- Kernel/Syscalls/chdir.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h index 9e271e2d8d..3ae12239f8 100644 --- a/Kernel/API/Syscall.h +++ b/Kernel/API/Syscall.h @@ -71,7 +71,7 @@ enum class NeedsBigProcessLock { S(execve, NeedsBigProcessLock::Yes) \ S(exit, NeedsBigProcessLock::Yes) \ S(exit_thread, NeedsBigProcessLock::Yes) \ - S(fchdir, NeedsBigProcessLock::Yes) \ + S(fchdir, NeedsBigProcessLock::No) \ S(fchmod, NeedsBigProcessLock::Yes) \ S(fchown, NeedsBigProcessLock::Yes) \ S(fcntl, NeedsBigProcessLock::Yes) \ diff --git a/Kernel/Syscalls/chdir.cpp b/Kernel/Syscalls/chdir.cpp index cfe91fda5f..9aac499f2d 100644 --- a/Kernel/Syscalls/chdir.cpp +++ b/Kernel/Syscalls/chdir.cpp @@ -23,7 +23,7 @@ ErrorOr Process::sys$chdir(Userspace user_path, size_t pat ErrorOr Process::sys$fchdir(int fd) { - VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this); + VERIFY_NO_PROCESS_BIG_LOCK(this); TRY(require_promise(Pledge::stdio)); auto description = TRY(open_file_description(fd)); if (!description->is_directory())