Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/nfs Fix vnode lock leak in nfsrv_mknod() if to-be-create...
details: https://anonhg.NetBSD.org/src/rev/e93527ebfb56
branches: trunk
changeset: 472673:e93527ebfb56
user: sommerfe <sommerfe%NetBSD.org@localhost>
date: Tue May 04 16:01:37 1999 +0000
description:
Fix vnode lock leak in nfsrv_mknod() if to-be-created vnode already existed.
diffstat:
sys/nfs/nfs_serv.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r a54dc6cf51f2 -r e93527ebfb56 sys/nfs/nfs_serv.c
--- a/sys/nfs/nfs_serv.c Tue May 04 15:58:53 1999 +0000
+++ b/sys/nfs/nfs_serv.c Tue May 04 16:01:37 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_serv.c,v 1.50 1999/03/30 12:01:18 mycroft Exp $ */
+/* $NetBSD: nfs_serv.c,v 1.51 1999/05/04 16:01:37 sommerfe Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -1570,7 +1570,12 @@
free((caddr_t)nd.ni_cnd.cn_pnbuf, M_NAMEI);
error = NFSERR_BADTYPE;
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
- vput(nd.ni_dvp);
+ if (nd.ni_dvp == nd.ni_vp)
+ vrele(nd.ni_dvp);
+ else
+ vput(nd.ni_dvp);
+ if (nd.ni_vp)
+ vput(nd.ni_vp);
goto out;
}
VATTR_NULL(&va);
@@ -1590,7 +1595,11 @@
free((caddr_t)nd.ni_cnd.cn_pnbuf, M_NAMEI);
error = EEXIST;
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
- vput(nd.ni_dvp);
+ if (nd.ni_dvp == nd.ni_vp)
+ vrele(nd.ni_dvp);
+ else
+ vput(nd.ni_dvp);
+ vput(nd.ni_vp);
goto out;
}
va.va_type = vtyp;
Home |
Main Index |
Thread Index |
Old Index