diff options
author | iedowse <iedowse@FreeBSD.org> | 2001-12-04 16:53:42 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2001-12-04 16:53:42 +0000 |
commit | e16d92f4dfef299b10a8f2cb74aacacac2c630a3 (patch) | |
tree | 3ffc9aed11ae39858b1a9b5823674029dc5cee77 | |
parent | 77d9f2e69304318365f0181558639ceaba84364d (diff) | |
download | FreeBSD-src-e16d92f4dfef299b10a8f2cb74aacacac2c630a3.zip FreeBSD-src-e16d92f4dfef299b10a8f2cb74aacacac2c630a3.tar.gz |
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
-rw-r--r-- | sys/nfsserver/nfs_serv.c | 5 |
1 files changed, 2 insertions, 3 deletions
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. */ |