diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-22 04:34:05 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-22 04:34:05 +0000 |
commit | 1d271c77129a2faf9fd621038dd1bebb80f43680 (patch) | |
tree | 4911194ad232b900a8723835bc3f08cda28387e2 /sys | |
parent | 78c99bbbea36583dba281be2a1363215ffa6255d (diff) | |
download | FreeBSD-src-1d271c77129a2faf9fd621038dd1bebb80f43680.zip FreeBSD-src-1d271c77129a2faf9fd621038dd1bebb80f43680.tar.gz |
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().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_extattr.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 6 |
2 files changed, 10 insertions, 2 deletions
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 |