From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com ([66.111.4.29]:50131 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727598AbeKNUsG (ORCPT ); Wed, 14 Nov 2018 15:48:06 -0500 From: Nikolaus Rath To: linux-fsdevel , Al Viro , Neil Brown Cc: Miklos Szeredi Subject: Behaviour of /proc/self/fd/NN Date: Wed, 14 Nov 2018 10:45:19 +0000 Message-ID: <87pnv8kke8.fsf@thinkpad.rath.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, If I understand Documentation/filesystems/path-lookup.md correctly, then the "symlinks" in /proc/self/fd/NN are not true symlinks but just presented as such to userspace. Does this mean that I can access (e.g., open(), setxattr(), or chmod()) these files without the possibility of race conditions? I.e., there is no way for someone to rename the target after the kernel has "looked up" the target but before the operation is applied? Secondly, under which conditions can I open the files in /proc? Does this still work if the destination file has been unlinked? Does it always follow renames? What if I mounted something over the destination? (Background: I'm trying to ascertain how well a true bind mount can be emulated by a passthrough FUSE filesystem). Best, -Nikolaus --=20 GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F =C2=BBTime flies like an arrow, fruit flies like a Banana.=C2= =AB