diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-05-28 13:11:35 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-05-28 13:11:35 +0000 |
commit | 527c640ad3d8edb87affe67b7ab6b2e6ded7f760 (patch) | |
tree | 15bb7965f78b1eb06801c34203d3fff942b5a017 /sys/kern/vfs_syscalls.c | |
parent | ff36d1a4939ff83639b86692662f26236f2d0efe (diff) | |
download | FreeBSD-src-527c640ad3d8edb87affe67b7ab6b2e6ded7f760.zip FreeBSD-src-527c640ad3d8edb87affe67b7ab6b2e6ded7f760.tar.gz |
Acquire Giant explicitly in quotactl() so that the syscalls.master
entry can become MSTD.
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index fb99bf6..e0ceeb4 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -164,6 +164,8 @@ SYSCTL_INT(_kern_prison, OID_AUTO, quotas, CTLFLAG_RW, &prison_quotas, 0, ""); /* * Change filesystem quotas. + * + * MP SAFE */ #ifndef _SYS_SYSPROTO_H_ struct quotactl_args { @@ -189,17 +191,23 @@ quotactl(td, uap) if (jailed(td->td_ucred) && !prison_quotas) return (EPERM); + mtx_lock(&Giant); NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); - if ((error = namei(&nd)) != 0) + if ((error = namei(&nd)) != 0) { + mtx_unlock(&Giant); return (error); + } NDFREE(&nd, NDF_ONLY_PNBUF); error = vn_start_write(nd.ni_vp, &vmp, V_WAIT | PCATCH); mp = nd.ni_vp->v_mount; vrele(nd.ni_vp); - if (error) + if (error) { + mtx_unlock(&Giant); return (error); + } error = VFS_QUOTACTL(mp, uap->cmd, uap->uid, uap->arg, td); vn_finished_write(vmp); + mtx_unlock(&Giant); return (error); } |