From: Jeff Layton <jlayton@kernel.org>
To: Kent Overstreet <kent.overstreet@linux.dev>,
"Darrick J. Wong" <djwong@kernel.org>
Cc: Neal Gompa <neal@gompa.dev>,
linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Josef Bacik <josef@toxicpanda.com>,
Miklos Szeredi <mszeredi@redhat.com>,
Christian Brauner <brauner@kernel.org>,
David Howells <dhowells@redhat.com>
Subject: Re: [PATCH v2] statx: stx_subvol
Date: Sat, 09 Mar 2024 06:46:54 -0500 [thread overview]
Message-ID: <4517677900bd6a29f4763abe868ab953b477772b.camel@kernel.org> (raw)
In-Reply-To: <6czkpcm4gxcjik3drcy6eys6lannfk55oowdesem2qr3gfgobw@lblo3vzck43e>
On Fri, 2024-03-08 at 12:13 -0500, Kent Overstreet wrote:
> On Fri, Mar 08, 2024 at 08:56:33AM -0800, Darrick J. Wong wrote:
> > On Fri, Mar 08, 2024 at 11:48:31AM -0500, Kent Overstreet wrote:
> > > It's a new feature, not a bugfix, this should never get backported. And
> > > I the bcachefs maintainer wrote the patch, and I'm submitting it to the
> > > VFS maintainer, so if it's fine with him it's fine with me.
> >
> > But then how am I supposed to bikeshed the structure of the V2 patchset
> > by immediately asking you to recombine the patches and spit out a V3?
> >
> > </sarcasm>
> >
> > But, seriously, can you update the manpage too?
>
> yeah, where's that at?
>
https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
> > Is stx_subvol a u64
> > cookie where userspace mustn't try to read anything into its contents?
> > Just like st_ino and st_dev are (supposed) to be?
>
> Actually, that's up for debate. I'm considering having the readdir()
> equivalent for walking subvolumes return subvolume IDs, and then there'd
> be a separate call to open by ID.
>
> Al's idea was to return open fds to child subvolumes, then userspace can
> get the path from /proc; that's also a possibility.
>
> The key thing is that with subvolumes it's actually possible to do an
> open_by_id() call with correct security checks on pathwalking - because
> we don't have hardlinks so there's no ambiguity.
>
> Or we might do it getdents() style and return the path directly.
>
> But I think userspace is going to want to work with the volume
> identifiers directly, which is partly why I'm considering why other
> options might be cleaner.
>
> Another thing to consider: where we're going with this is giving
> userspace a good efficient interrface for recursive tree traversal of
> subvolumes, but it might not be a bad idea to do that for mountpoints as
> well - similar problems, similar scalability issues that we might want
> to solve eventually.
>
All of that's fine, but Darrick's question is about whether we should
ensure that these IDs are considered _opaque_. I think they should be.
We don't want to anyone to fall into the trap of trying to convey extra
info to userland about the volumes via this value. It should only be
good for uniquely identifying the volume.
We'll also need to document the scope of uniqueness. I assume we'll want
to define this as only being unique within a single filesystem? IOW, if
I have 2 bcachefs filesystems that are on independent devices, these
values may collide? Someone wanting to uniquely identify a subvolume on
a system will need to check both the st_dev and the st_vol, correct?
> > Should the XFS data and rt volumes be reported with different stx_vol
> > values?
>
> Maybe?
>
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2024-03-09 11:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 2:29 [PATCH v2] statx: stx_subvol Kent Overstreet
2024-03-08 11:42 ` Neal Gompa
2024-03-08 16:34 ` Kent Overstreet
2024-03-08 16:44 ` Neal Gompa
2024-03-08 16:48 ` Kent Overstreet
2024-03-08 16:56 ` Darrick J. Wong
2024-03-08 17:13 ` Kent Overstreet
2024-03-09 11:46 ` Jeff Layton [this message]
2024-03-09 12:15 ` Kent Overstreet
2024-03-11 2:17 ` Dave Chinner
2024-03-11 5:30 ` Miklos Szeredi
2024-03-11 5:49 ` Kent Overstreet
2024-03-11 13:42 ` Christian Brauner
2024-03-11 8:12 ` Johannes Thumshirn
2024-03-11 13:43 ` Christian Brauner
2024-03-11 20:15 ` Kent Overstreet
2024-03-12 14:27 ` Christian Brauner
2024-03-11 22:43 ` David Sterba
2024-03-12 14:27 ` Christian Brauner
2024-03-12 17:17 ` Neal Gompa
2024-03-12 2:13 ` Eric Biggers
2024-05-28 12:46 ` John Garry
2024-05-28 22:11 ` Andreas Dilger
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=4517677900bd6a29f4763abe868ab953b477772b.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=brauner@kernel.org \
--cc=dhowells@redhat.com \
--cc=djwong@kernel.org \
--cc=josef@toxicpanda.com \
--cc=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=neal@gompa.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).