Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Mar 2018 10:42:33 -0800
From:      Christoph Hellwig <hch@infradead.org>
To:        Konstantin Belousov <kib@freebsd.org>
Cc:        Christoph Hellwig <hch@infradead.org>, "Robert N. M. Watson" <robert.watson@cl.cam.ac.uk>, "<cl-capsicum-discuss@lists.cam.ac.uk>" <cl-capsicum-discuss@lists.cam.ac.uk>,  Mariusz Zaborski <oshogbo@freebsd.org>, Justin Cormack <justin@specialbusservice.com>, freebsd-hackers@freebsd.org
Subject:   Re: [capsicum] unlinkfd
Message-ID:  <20180305184233.GA11236@infradead.org>
In-Reply-To: <20180305161508.GE76926@kib.kiev.ua>
References:  <20180302183514.GA99279@x-wing> <CAK4o1Wyk54chHobhUkb2PBUtaWOF2rDv6tkX_bFGY6D331xUqw@mail.gmail.com> <17DE0BFF-42A2-4CD7-B09C-ABA2606C4041@cl.cam.ac.uk> <20180305155550.GA22789@infradead.org> <20180305161508.GE76926@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180305184233.GA11236>