summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2005-07-27 15:05:31 +0000
committerps <ps@FreeBSD.org>2005-07-27 15:05:31 +0000
commitc30cfa7b9be54feada4b0a43145ba8b75482a4cb (patch)
tree561e99d7732463a2d56e6843b78ebd7b0f2a312f /sys
parentca8316b8dd70d583004789919db2eb8cc4720940 (diff)
downloadFreeBSD-src-c30cfa7b9be54feada4b0a43145ba8b75482a4cb.zip
FreeBSD-src-c30cfa7b9be54feada4b0a43145ba8b75482a4cb.tar.gz
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
Diffstat (limited to 'sys')
-rw-r--r--sys/nfsclient/nfs_node.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c
index f8621ae..47f5f4e 100644
--- a/sys/nfsclient/nfs_node.c
+++ b/sys/nfsclient/nfs_node.c
@@ -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) {
OpenPOWER on IntegriCloud