In nfs_nget() if two threads race on the same filehandle, the loser should

cause the nfsnode to get freed. This fixes a potential vnode (and nfsnode)
leak in that path.

Submitted by:	Mohan Srinivasan
Reviewed by:	phk
This commit is contained in:
ps 2005-07-27 15:05:31 +00:00
parent ca8316b8dd
commit c30cfa7b9b

View File

@ -154,7 +154,8 @@ nfs_nget(struct mount *mntp, nfsfh_t *fhp, int fhsize, struct nfsnode **npp)
return (error);
if (nvp != NULL) {
*npp = VTONFS(nvp);
/* XXX I wonder of nfs_reclaim will survive the unused vnode */
/* vrele() the duplicate allocated here, to get it recycled */
vrele(vp);
return (0);
}
if (fhsize > NFS_SMALLFH) {