summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_serv.c
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1999-11-13 20:58:17 +0000
committereivind <eivind@FreeBSD.org>1999-11-13 20:58:17 +0000
commit4ce73d70968875fa0c07f07e90a2bdcb84726bd6 (patch)
tree1a5eba3223a453fbc8060d31521181433ce7f3f3 /sys/nfs/nfs_serv.c
parent91b25fa7a9d94c9097d6ebf1d8ec6b1a332f8e04 (diff)
downloadFreeBSD-src-4ce73d70968875fa0c07f07e90a2bdcb84726bd6.zip
FreeBSD-src-4ce73d70968875fa0c07f07e90a2bdcb84726bd6.tar.gz
Remove WILLRELE from VOP_SYMLINK
Note: Previous commit to these files (except coda_vnops and devfs_vnops) that claimed to remove WILLRELE from VOP_RENAME actually removed it from VOP_MKNOD.
Diffstat (limited to 'sys/nfs/nfs_serv.c')
-rw-r--r--sys/nfs/nfs_serv.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 681c3a6..122e7f3 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -68,13 +68,10 @@
* error occurs. If no error occurs, the VOP_*() routines only free
* the path component if SAVESTART is NOT set.
*
- * VOP_SYMLINK, lookup(), and namei()
+ * lookup() and namei()
* may return garbage in various structural fields/return elements
* if an error is returned, and may garbage up nd.ni_dvp even if no
* error is returned and you did not request LOCKPARENT or WANTPARENT.
- * VOP_SYMLINK return garbage in its return vnode (i.e. not
- * something we need to release) even if no error occurs. Our cleanup
- * code is sensitive to garbage, so we have to carefully clear it out.
*
* We use the ni_cnd.cn_flags 'HASBUF' flag to track whether the name
* buffer has been freed or not. This is unique to nfs_serv.c for
@@ -1699,10 +1696,6 @@ nfsrv_create(nfsd, slp, procp, mrq)
nd.ni_cnd.cn_flags &= ~HASBUF;
goto nfsmreply0;
}
-
- /*
- * release vp we do not use
- */
vput(nd.ni_vp);
nd.ni_vp = NULL;
@@ -1912,10 +1905,6 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
nd.ni_cnd.cn_flags &= ~HASBUF;
goto out;
}
-
- /*
- * release vp we do not use
- */
vput(nd.ni_vp);
nd.ni_vp = NULL;
@@ -2559,14 +2548,16 @@ nfsrv_symlink(nfsd, slp, procp, mrq)
/*
* issue symlink op. SAVESTART is set so the underlying path component
- * is only freed by the VOP if an error occurs. VOP_SYMLINK does not
- * return a referenced ni_vp, but it may fill the pointer with garbage.
+ * is only freed by the VOP if an error occurs.
*/
nqsrv_getl(nd.ni_dvp, ND_WRITE);
error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, vap, pathcp);
- nd.ni_vp = NULL;
if (error)
nd.ni_cnd.cn_flags &= ~HASBUF;
+ else {
+ vput(nd.ni_vp);
+ nd.ni_vp = NULL;
+ }
/*
* releases directory prior to potential lookup op.
*/
OpenPOWER on IntegriCloud