From owner-svn-src-all@FreeBSD.ORG Mon Jun 15 21:02:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28A8D1065679; Mon, 15 Jun 2009 21:02:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id BB7958FC31; Mon, 15 Jun 2009 21:02:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1MGJJu-0008DD-E3; Tue, 16 Jun 2009 00:02:22 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n5FL2JJB098025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Jun 2009 00:02:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n5FL2JxD051524; Tue, 16 Jun 2009 00:02:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n5FL2ID7051523; Tue, 16 Jun 2009 00:02:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 16 Jun 2009 00:02:18 +0300 From: Kostik Belousov To: John Baldwin Message-ID: <20090615210218.GS23592@deviant.kiev.zoral.com.ua> References: <200906152038.n5FKctaR001026@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8DtChEGCcMdSgkU2" Content-Disposition: inline In-Reply-To: <200906152038.n5FKctaR001026@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.1 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1MGJJu-0008DD-E3 39838eac427f415681f76d38b2cdde6d X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 21:02:28 -0000 --8DtChEGCcMdSgkU2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 15, 2009 at 08:38:55PM +0000, John Baldwin wrote: > Author: jhb > Date: Mon Jun 15 20:38:55 2009 > New Revision: 194262 > URL: http://svn.freebsd.org/changeset/base/194262 >=20 > Log: > Note that this implementation of closefrom(2) does not make any effort = to > resolve userland races with open(2) in other threads. As such, it is n= ot > multithread safe. =2E.. > + FILEDESC_SLOCK(fdp); > + for (fd =3D uap->lowfd; fd < fdp->fd_nfiles; fd++) { > + if (fdp->fd_ofiles[fd] !=3D NULL) { > + FILEDESC_SUNLOCK(fdp); > + (void)kern_close(td, fd); > + FILEDESC_SLOCK(fdp); > + } > + } > + FILEDESC_SUNLOCK(fdp); Just curious why this was not implemented in userspace ? Audit + fd_nfiles, perhaps ? I am sorry, but somebody would ask this question anyway, so why not me ? --8DtChEGCcMdSgkU2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAko2ttoACgkQC3+MBN1Mb4iPSACg1BIc0glya2bZEbey8ZPT24jr Q8oAoKoh7FSS1wqf4SL5e/Qofxnrv2tK =Q9Ng -----END PGP SIGNATURE----- --8DtChEGCcMdSgkU2--