nfs_nget() does no locking whatsoever when looking up a vnode. If the

vget() sleeps we have to retry the operation to avoid racing against
a deletion.

MFC maybe: submitted to re's
This commit is contained in:
Matthew Dillon 2001-12-27 19:40:34 +00:00
parent 979c74a0af
commit 885d36ce36
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=88541

View File

@ -194,7 +194,10 @@ nfs_nget(struct mount *mntp, nfsfh_t *fhp, int fhsize, struct nfsnode **npp)
bcmp((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize))
continue;
vp = NFSTOV(np);
if (vget(vp, LK_EXCLUSIVE, td))
/*
* np or vp may become invalid if vget() blocks, so loop
*/
if (vget(vp, LK_EXCLUSIVE|LK_SLEEPFAIL, td))
goto loop;
*npp = np;
return(0);