From 0b8d3eb375291d3fac1879585e4d61e0702b40da Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 8 Mar 2002 13:43:43 +0000 Subject: vhold() our vnode while checking the remote side. This is belived to be the only place where a soft reference to a vnode is held with no sort of hard reference, consequently this change should allow us to free(9) vnodes from the freelist after properly cleaning them up. Reviewed by: dillon --- sys/nfsclient/nfs_vnops.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys/nfsclient') diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 9d40b89..d9bdcea 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -776,6 +776,7 @@ nfs_lookup(struct vop_lookup_args *ap) return (error); } + vhold(*vpp); newvp = *vpp; vpid = newvp->v_id; /* @@ -809,6 +810,7 @@ nfs_lookup(struct vop_lookup_args *ap) if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; + vdrop(newvp); return (0); } cache_purge(newvp); @@ -817,6 +819,7 @@ nfs_lookup(struct vop_lookup_args *ap) if (lockparent && dvp != newvp && (flags & ISLASTCN)) VOP_UNLOCK(dvp, 0, td); } + vdrop(newvp); error = vn_lock(dvp, LK_EXCLUSIVE, td); *vpp = NULLVP; if (error) { -- cgit v1.1