From 107d27c57da48ed17ec0ee34c5b0f45f069b114c Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Sun, 16 Jul 1989 21:21:22 -0800 Subject: [PATCH] avoid dangling reference for cdir when doing rename SCCS-vsn: sys/nfs/nfs_serv.c 7.5 --- usr/src/sys/nfs/nfs_serv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/src/sys/nfs/nfs_serv.c b/usr/src/sys/nfs/nfs_serv.c index 461585ab7c..b7e327af7d 100644 --- a/usr/src/sys/nfs/nfs_serv.c +++ b/usr/src/sys/nfs/nfs_serv.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#)nfs_serv.c 7.4 (Berkeley) %G% + * @(#)nfs_serv.c 7.5 (Berkeley) %G% */ /* @@ -738,10 +738,12 @@ out: VOP_ABORTOP(&tond); VOP_ABORTOP(ndp); } else { + VREF(tond.ni_cdir); error = VOP_RENAME(ndp, &tond); + vrele(tond.ni_cdir); } out1: - ndrele(&tond); + ndrele(ndp); nfsm_reply(0); return (error); nfsmout: -- 2.20.1