When VOP_SYMLINK fails, the value of *vpp is junk, so we must NULL

out nd.ni_vp to prevent the resource cleanup code at the end of
nfsrv_symlink from trying to vrele it. This fixes a "vrele: negative
ref cnt" panic that can occur when a symlink is attempted on an NFS
filesystem with no free space. Found locally, but the symptoms
correspond to those in the PR referenced below.

PR:		kern/26878
MFC after:	3 days
This commit is contained in:
Ian Dowse 2001-12-04 16:53:42 +00:00
parent 830a9d770e
commit eec7ff8aa6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87361

View File

@ -2586,10 +2586,9 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, vap, pathcp);
if (error)
NDFREE(&nd, NDF_ONLY_PNBUF);
else {
else
vput(nd.ni_vp);
nd.ni_vp = NULL;
}
nd.ni_vp = NULL;
/*
* releases directory prior to potential lookup op.
*/