From: Nikolaus Rath <Nikolaus@rath.org>
To: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>, Neil Brown <neil@brown.name>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Subject: Behaviour of /proc/self/fd/NN
Date: Wed, 14 Nov 2018 10:45:19 +0000 [thread overview]
Message-ID: <87pnv8kke8.fsf@thinkpad.rath.org> (raw)
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
--
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F
»Time flies like an arrow, fruit flies like a Banana.«
next reply other threads:[~2018-11-14 20:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-14 10:45 Nikolaus Rath [this message]
2018-11-14 11:57 ` Behaviour of /proc/self/fd/NN Miklos Szeredi
2018-11-14 12:10 ` Nikolaus Rath
2018-11-14 12:20 ` Miklos Szeredi
2018-11-14 12:29 ` Nikolaus Rath
2018-11-14 12:33 ` Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pnv8kke8.fsf@thinkpad.rath.org \
--to=nikolaus@rath.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=neil@brown.name \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.