From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 21:10:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 618A01065874; Mon, 15 Jun 2009 21:10:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2D67F8FC29; Mon, 15 Jun 2009 21:10:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D7C9D46B51; Mon, 15 Jun 2009 17:10:13 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E154F8A070; Mon, 15 Jun 2009 17:10:12 -0400 (EDT) From: John Baldwin To: Kostik Belousov Date: Mon, 15 Jun 2009 17:08:11 -0400 User-Agent: KMail/1.9.7 References: <200906152038.n5FKctaR001026@svn.freebsd.org> <20090615210218.GS23592@deviant.kiev.zoral.com.ua> In-Reply-To: <20090615210218.GS23592@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906151708.11776.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 15 Jun 2009 17:10:12 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 21:10:19 -0000 On Monday 15 June 2009 5:02:18 pm Kostik Belousov wrote: > 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 > > > > 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 not > > multithread safe. > ... > > + FILEDESC_SLOCK(fdp); > > + for (fd = uap->lowfd; fd < fdp->fd_nfiles; fd++) { > > + if (fdp->fd_ofiles[fd] != 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 ? I will defer to Robert so he can expound on this. :) -- John Baldwin