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:
parent
979c74a0af
commit
885d36ce36
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user