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

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);