summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-06-22 04:34:05 +0000
committerrwatson <rwatson@FreeBSD.org>2004-06-22 04:34:05 +0000
commit1d271c77129a2faf9fd621038dd1bebb80f43680 (patch)
tree4911194ad232b900a8723835bc3f08cda28387e2 /sys
parent78c99bbbea36583dba281be2a1363215ffa6255d (diff)
downloadFreeBSD-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.c6
-rw-r--r--sys/kern/vfs_syscalls.c6
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
OpenPOWER on IntegriCloud