From: Al Viro <viro@ZenIV.linux.org.uk>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, samba-technical@lists.samba.org,
Eric Biggers <ebiggers@kernel.org>
Subject: Re: Streams support in Linux
Date: Sat, 25 Aug 2018 19:00:26 +0100 [thread overview]
Message-ID: <20180825180026.GR6515@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20180825155150.GA3581@bombadil.infradead.org>
On Sat, Aug 25, 2018 at 08:51:50AM -0700, Matthew Wilcox wrote:
> > What do you do for access via /proc/*/fd/*, when descriptor is a sodding
> > stream?
>
> I don't know. Is it useful to be able to access them that way?
I don't know - I've no idea who needs that... little gem of elegance in the
first place.
> > > renameat()
> > > If olddirfd + oldpath refers to a stream then newdirfd + newpath must
> > > refer to a stream within the same parent object. If that stream exists,
> > > it is removed. If olddirfd + oldpath does not refer to a stream, then
> > > newdirfd + newpath must not refer to a stream.
> >
> > And here the shit begins - what to do when parents have different dentries?
> > Directories can't have hardlinks; regular files very much can.
>
> I presume you mean from a locking point of view? In my mind, we check that
> old and new resolve to the same inode and take a lock on that inode.
Now, if that was all we ever needed...
> > Where do dentries of these things belong, anyway?
>
> Do streams have to have dentries? They don't have names in the hierarchy.
> Can they share their parent's dentry? Can they have a NULL dentry? Or
> a magic dentry of some kind?
If you want them as opened files - yes, they have to, no, they can't and no,
they can't.
> > > unlinkat()
> > > This is how you remove an individual named stream
> >
> > Yeah... and what happens to access via other hardlinks to the same parent
> > file?
>
> I'm not sure I understand the problem here. You have, say /a/b/c
> and /d which refer to the same inode. This inode has streams x and y.
> If you unlinkat() /a/b/c::x then it is no longer openable. Any currently
> existing open fds for x keep x alive until the last one is closed, no
> matter which path was used to open them.
Again, where it the tree would the dentries live? And I really hope you are
not suggesting to reserve '::' - not when we have files like
/usr/share/man/man3/Params::Check.3perl.gz
just to pull a random line out of locate :: output here...
> > > Unlinking a file with named streams removes all named streams from that
> > > file and then unlinks the file. Open streams will continue to exist in
> > > the filesystem until they are closed, just as unlinked files do.
> >
> > Can they be looked up by openat() from such a starting point?
>
> No, you can't use openat() on a stream fd. I should have been clearer
> on that above; this proposal should have split the syscall list in two;
> one for how the syscall behaves on a fd-for-a-file-with-streams and one
> for how the syscall behaves on a stream-fd.
I'm not suggesting passing a stream fd as the starting point; just a normal
opened-and-then-unlinked regular file.
> Right, but that code also assumes it's dealing with files.
I'm looking forward to your analysis of all code related to dentry tree,
with an eye towards the places where such asserts are quietly made...
next prev parent reply other threads:[~2018-08-25 21:40 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-25 13:51 Streams support in Linux Matthew Wilcox
2018-08-25 14:47 ` Al Viro
2018-08-25 15:51 ` Matthew Wilcox
2018-08-25 18:00 ` Al Viro [this message]
2018-08-25 20:57 ` Matthew Wilcox
2018-08-25 22:36 ` Al Viro
2018-08-26 1:03 ` Steve French
2018-08-27 17:05 ` Jeremy Allison
2018-08-27 17:41 ` Jeremy Allison
2018-08-27 18:21 ` Matthew Wilcox
2018-08-27 18:45 ` Al Viro
2018-08-27 19:06 ` Jeremy Allison
2018-08-28 0:45 ` Theodore Y. Ts'o
2018-08-28 1:07 ` Steve French
2018-08-28 18:12 ` Jeremy Allison
2018-08-28 18:32 ` Steve French
2018-08-28 18:40 ` Jeremy Allison
2018-08-28 19:43 ` Steve French
2018-08-28 19:47 ` Jeremy Allison
2018-08-28 20:43 ` Steve French
2018-08-28 20:47 ` Jeremy Allison
2018-08-28 20:51 ` Steve French
2018-08-28 21:19 ` Stefan Metzmacher
2018-08-28 21:22 ` Jeremy Allison
2018-08-28 21:23 ` Steve French
2018-08-29 5:13 ` Ralph Böhme
2018-08-29 13:46 ` Tom Talpey
2018-08-29 13:54 ` Aurélien Aptel
2018-08-29 15:02 ` Tom Talpey
2018-08-29 16:00 ` Jeremy Allison
2018-08-29 15:59 ` Jeremy Allison
2018-08-29 18:52 ` Andreas Dilger
2018-08-26 20:30 ` Matthew Wilcox
2018-08-25 16:25 ` Theodore Y. Ts'o
2018-08-27 16:33 ` Jeremy Allison
-- strict thread matches above, loose matches on Subject: below --
2018-09-20 2:06 Shahbaz Youssefi
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=20180825180026.GR6515@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=ebiggers@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=samba-technical@lists.samba.org \
--cc=willy@infradead.org \
/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.