summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-10-27 19:02:34 +0000
committerglebius <glebius@FreeBSD.org>2005-10-27 19:02:34 +0000
commitc593d62fd62f48ce77327389a40bc9bf8e0fcc4b (patch)
tree6c199e068cc23a74fecb3548cdd89a77c13c7ec5 /sys/nfsserver
parent4da49aa3a472fa5614fa240f50abc02dff1f0af9 (diff)
downloadFreeBSD-src-c593d62fd62f48ce77327389a40bc9bf8e0fcc4b.zip
FreeBSD-src-c593d62fd62f48ce77327389a40bc9bf8e0fcc4b.tar.gz
Keep locks consistent before goto.
Reported by: pho Reviewed by: mohans
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_serv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 4a028fa..e366745 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -2092,6 +2092,8 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
tl = nfsm_dissect_nonblock(u_int32_t *, NFSX_UNSIGNED);
vtyp = nfsv3tov_type(*tl);
if (vtyp != VCHR && vtyp != VBLK && vtyp != VSOCK && vtyp != VFIFO) {
+ NFSD_UNLOCK();
+ mtx_lock(&Giant); /* VFS */
error = NFSERR_BADTYPE;
goto out;
}
@@ -2108,6 +2110,8 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
* Iff doesn't exist, create it.
*/
if (nd.ni_vp) {
+ NFSD_UNLOCK();
+ mtx_lock(&Giant); /* VFS */
error = EEXIST;
goto out;
}
OpenPOWER on IntegriCloud