summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-03-08 13:43:43 +0000
committerphk <phk@FreeBSD.org>2002-03-08 13:43:43 +0000
commit0b8d3eb375291d3fac1879585e4d61e0702b40da (patch)
tree49e5c3d9d4a9afc9b1cac0d7c356678999386d65 /sys/nfsclient
parent0a97605a6c87d27444f11cb0bf824b6e8f881d07 (diff)
downloadFreeBSD-src-0b8d3eb375291d3fac1879585e4d61e0702b40da.zip
FreeBSD-src-0b8d3eb375291d3fac1879585e4d61e0702b40da.tar.gz
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
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_vnops.c3
1 files changed, 3 insertions, 0 deletions
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) {
OpenPOWER on IntegriCloud