From 6354a9a0303af2f8ece388c72907bbeb89196723 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 7 Mar 2022 21:38:10 +0100 Subject: [PATCH] Kernel: Mark sys$fsync() 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/fsync.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h index 2fb5c580cc..9ef87ca331 100644 --- a/Kernel/API/Syscall.h +++ b/Kernel/API/Syscall.h @@ -78,7 +78,7 @@ enum class NeedsBigProcessLock { S(fork, NeedsBigProcessLock::Yes) \ S(fstat, NeedsBigProcessLock::No) \ S(fstatvfs, NeedsBigProcessLock::Yes) \ - S(fsync, NeedsBigProcessLock::Yes) \ + S(fsync, NeedsBigProcessLock::No) \ S(ftruncate, NeedsBigProcessLock::Yes) \ S(futex, NeedsBigProcessLock::Yes) \ S(get_dir_entries, NeedsBigProcessLock::Yes) \ diff --git a/Kernel/Syscalls/fsync.cpp b/Kernel/Syscalls/fsync.cpp index f726c4cfb6..89b91152fd 100644 --- a/Kernel/Syscalls/fsync.cpp +++ b/Kernel/Syscalls/fsync.cpp @@ -10,7 +10,7 @@ namespace Kernel { ErrorOr Process::sys$fsync(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)); TRY(description->sync());