Date: Tue, 15 Jul 2008 23:36:41 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Rick Macklem <rmacklem@uoguelph.ca> Cc: freebsd-fs@freebsd.org Subject: Re: executable open until unmount Message-ID: <20080715203641.GA17123@deviant.kiev.zoral.com.ua> In-Reply-To: <Pine.GSO.4.63.0807151453130.12638@muncher.cs.uoguelph.ca> References: <Pine.GSO.4.63.0807151453130.12638@muncher.cs.uoguelph.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
--3Klj4d7nt2xGOswL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 15, 2008 at 02:57:23PM -0400, Rick Macklem wrote: > I'm testing my nfsv4 client and I've run into this issue under FreeBSD7.0. >=20 > When I execute a file on the nfs mounted volume, the file remains open > until the vnode gets cleared out, usually when I unmount. For NFSv4, this > isn't a particularily good thing, since these Opens tie up resources on > the NFS server, etc. >=20 > Anyone know if there is something I'm doing incorrectly that causes this= =20 > or a way to get the close to happen when the executable terminates? >=20 > Thanks in advance for any help, rick Try this: diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index f4335a2..c3ef0e9 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -496,6 +496,7 @@ interpret: interplabel =3D mac_vnode_label_alloc(); mac_vnode_copy_label(binvp->v_label, interplabel); #endif + VOP_CLOSE(binvp, FREAD, td->td_ucred, td); vput(binvp); vm_object_deallocate(imgp->object); imgp->object =3D NULL; @@ -845,6 +846,7 @@ exec_fail_dealloc: if (imgp->vp !=3D NULL) { if (args->fname) NDFREE(ndp, NDF_ONLY_PNBUF); + VOP_CLOSE(imgp->vp, FREAD, td->td_ucred, td); vput(imgp->vp); } =20 --3Klj4d7nt2xGOswL Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkh9ClgACgkQC3+MBN1Mb4iGkACdFDUQblFAhYx/p4/5TWfPyDR+ LOUAn1LY0GLq7xLQToEV1ttkc3LOP2mL =LWL/ -----END PGP SIGNATURE----- --3Klj4d7nt2xGOswL--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080715203641.GA17123>