From 1d271c77129a2faf9fd621038dd1bebb80f43680 Mon Sep 17 00:00:00 2001 From: rwatson Date: Tue, 22 Jun 2004 04:34:05 +0000 Subject: Acquire Giant in link() so that the system call can be marked MPSAFE. Don't want to acquire Giant in kern_link() sync linux compat code performs actions requiring Giant prior to calling kern_link(). --- sys/kern/vfs_extattr.c | 6 +++++- sys/kern/vfs_syscalls.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 38b21e4..82571bc 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -1595,8 +1595,12 @@ unlink(td, uap) char *path; } */ *uap; { + int error; - return (kern_unlink(td, uap->path, UIO_USERSPACE)); + mtx_lock(&Giant); + error = kern_unlink(td, uap->path, UIO_USERSPACE); + mtx_unlock(&Giant); + return (error); } int diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 38b21e4..82571bc 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1595,8 +1595,12 @@ unlink(td, uap) char *path; } */ *uap; { + int error; - return (kern_unlink(td, uap->path, UIO_USERSPACE)); + mtx_lock(&Giant); + error = kern_unlink(td, uap->path, UIO_USERSPACE); + mtx_unlock(&Giant); + return (error); } int -- cgit v1.1