From owner-freebsd-hackers@freebsd.org Mon Mar 5 16:15:57 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 9CA80F3BF1E for ; Mon, 5 Mar 2018 16:15:57 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 E4C5580BB9; Mon, 5 Mar 2018 16:15:56 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w25GF8w4082407 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 5 Mar 2018 18:15:12 +0200 (EET) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w25GF8w4082407 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w25GF8rr082406; Mon, 5 Mar 2018 18:15:08 +0200 (EET) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Mon, 5 Mar 2018 18:15:08 +0200 From: Konstantin Belousov To: Christoph Hellwig Cc: "Robert N. M. Watson" , "" , Mariusz Zaborski , Justin Cormack , freebsd-hackers@freebsd.org Subject: Re: [capsicum] unlinkfd Message-ID: <20180305161508.GE76926@kib.kiev.ua> References: <20180302183514.GA99279@x-wing> <17DE0BFF-42A2-4CD7-B09C-ABA2606C4041@cl.cam.ac.uk> <20180305155550.GA22789@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180305155550.GA22789@infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home 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 16:15:57 -0000 On Mon, Mar 05, 2018 at 07:55:50AM -0800, Christoph Hellwig wrote: > With my Linux hat I'd much prefer using the AT_EMPTY_PATH flag that > Linux already supports for a few *at calls to operate on the dirfd > fd. But it seems like neither FreeBSD nor anyone else picked up that > flag, so it might be a bit of a hard sell. > > FreeBSD bugzilla related to AT_EMPTY_PATH and the lack of it for > unlinkat even in Linux: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197778 > > Linux bugzilla: > > https://bugzilla.kernel.org/show_bug.cgi?id=93441 > > If you are interested in bringing this to FreeBSD that might be reason > enough for me into looking into a Linux implementation as well. 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) ? 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.