summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-11-20 07:32:52 +0000
committerpjd <pjd@FreeBSD.org>2006-11-20 07:32:52 +0000
commit62a0bc913ec6e039cadca1c6dd3d7544f350b9f4 (patch)
tree89b6c9ec6ebd6858faea790a2b99442f5cb394f4 /sys/nfsserver
parent5df82d7e99a4bdd3a478e693696a58baaf900288 (diff)
downloadFreeBSD-src-62a0bc913ec6e039cadca1c6dd3d7544f350b9f4.zip
FreeBSD-src-62a0bc913ec6e039cadca1c6dd3d7544f350b9f4.tar.gz
Protect nfsm_srvpathsiz() call with the nfsd_mtx lock.
Reviewed by: mohans
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_serv.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 82d9ead..c193bf6 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -2829,6 +2829,12 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
nd.ni_cnd.cn_flags = LOCKPARENT | SAVESTART;
error = nfs_namei(&nd, fhp, len, slp, nam, &md, &dpos,
&dirp, v3, &dirfor, &dirfor_ret, td, FALSE);
+ if (error == 0) {
+ VATTR_NULL(vap);
+ if (v3)
+ nfsm_srvsattr(vap);
+ nfsm_srvpathsiz(len2);
+ }
NFSD_UNLOCK();
mtx_lock(&Giant); /* VFS */
if (dirp && !v3) {
@@ -2837,11 +2843,6 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
}
if (error)
goto out;
-
- VATTR_NULL(vap);
- if (v3)
- nfsm_srvsattr(vap);
- nfsm_srvpathsiz(len2);
MALLOC(pathcp, caddr_t, len2 + 1, M_TEMP, M_WAITOK);
iv.iov_base = pathcp;
iv.iov_len = len2;
OpenPOWER on IntegriCloud