From e16d92f4dfef299b10a8f2cb74aacacac2c630a3 Mon Sep 17 00:00:00 2001 From: iedowse Date: Tue, 4 Dec 2001 16:53:42 +0000 Subject: 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 --- sys/nfsserver/nfs_serv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sys/nfsserver') diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 159e190..d0c290c 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -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. */ -- cgit v1.1