From owner-freebsd-hackers@freebsd.org Mon Mar 5 18:42:35 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE47AF465A7 for ; Mon, 5 Mar 2018 18:42:35 +0000 (UTC) (envelope-from BATV+99cf327d66dc6ede388e+5307+infradead.org+hch@bombadil.srs.infradead.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56D176839F; Mon, 5 Mar 2018 18:42:35 +0000 (UTC) (envelope-from BATV+99cf327d66dc6ede388e+5307+infradead.org+hch@bombadil.srs.infradead.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Q5BiZcZ9L/SISn4w80XuJXKVlLEHiDKHBvn5qgJWrFQ=; b=s6/oNNCnb6a3FkMQSVHye1Ag9 tMD25oJ1sgoakLtyo/lAJRj/vdGJ6c2ky11pjDnV+UsZD1fu+aDffzPL/wust/qrjR853VXvdySBe Dp9/x8LHdx9d14tduI/CQx8dCxYIdqGoKaZ99YhtiF3d7XXKWawY+RfgY3CRioo4yBbQo97EP8WaF RidDeP8GOq58nsiHzR0AEmiJsQkUD/sT2TnVMsuUJw/DHunGi99Smx7JcOaIetTkclYwzpcCGI2aI fwH29e5adTdzuw2fpMEQZo7FqvOnAcSFPTMF5KFuseyMyskWFF2bQN8fvmqTbw2LIdtEHbv0CTy2d EzGcjCTUA==; Received: from hch by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1esv4D-00057S-OT; Mon, 05 Mar 2018 18:42:33 +0000 Date: Mon, 5 Mar 2018 10:42:33 -0800 From: Christoph Hellwig To: Konstantin Belousov Cc: Christoph Hellwig , "Robert N. M. Watson" , "" , Mariusz Zaborski , Justin Cormack , freebsd-hackers@freebsd.org Subject: Re: [capsicum] unlinkfd Message-ID: <20180305184233.GA11236@infradead.org> References: <20180302183514.GA99279@x-wing> <17DE0BFF-42A2-4CD7-B09C-ABA2606C4041@cl.cam.ac.uk> <20180305155550.GA22789@infradead.org> <20180305161508.GE76926@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180305161508.GE76926@kib.kiev.ua> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2018 18:42:35 -0000 On Mon, Mar 05, 2018 at 06:15:08PM +0200, Konstantin Belousov wrote: > It is not clear from the FreeBSD PR, how unlinkat() is supposed to work. > Do you mean that unlinkat(AT_EMPTY_PATH) removes the name entry for > given fd, which was used for open(2) ? It removes the current name for the open fd, including tracking renames that might have happened since open. > If yes, this is not possible to > implement in the current FreeBSD VFS. > > Also, does linkat(AT_EMPTY_PATH) supposed to link the inode referenced > only by the file descriptor ? I believe this feature is objected to. linkat(..., AT_EMPTY_PATH) in Linux creates a new link to inode reference by the fd. It is a privileged operation, and requires the inode to already have a non-zero link count, or be opened using the Linux-specific O_TMPFILE flag, which creates and open by unlinked file.