From: Christian Brauner <brauner@kernel.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: David Howells <dhowells@redhat.com>,
Amir Goldstein <amir73il@gmail.com>,
Dave Chinner <david@fromorbit.com>, NeilBrown <neilb@suse.de>,
Kent Overstreet <kent.overstreet@linux.dev>,
Donald Buczek <buczek@molgen.mpg.de>,
linux-bcachefs@vger.kernel.org,
Stefan Krueger <stefan.krueger@aei.mpg.de>,
linux-fsdevel@vger.kernel.org, Josef Bacik <josef@toxicpanda.com>,
linux-btrfs@vger.kernel.org
Subject: Re: file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?)
Date: Tue, 12 Dec 2023 16:24:33 +0100 [thread overview]
Message-ID: <20231212-untiefen-leihwagen-ca303230fc4e@brauner> (raw)
In-Reply-To: <CAJfpegu3uwAjMQd2jrBty0Lx-oHOczF0x6xNkyqcT4MBqyJo7Q@mail.gmail.com>
On Tue, Dec 12, 2023 at 03:06:07PM +0100, Miklos Szeredi wrote:
> On Tue, 12 Dec 2023 at 14:48, Christian Brauner <brauner@kernel.org> wrote:
>
> > Exposing the subvolume id in statx() is still fine imho. It's a concept
> > shared between btrfs and bcachefs and it's pretty useful for interested
> > userspace that wants to make use of these apis.
>
> Exposing subvolume ID should be okay, as long as it's not advertised
> as a way to uniquely identify an inode. Its use should be limited to
> finding subvolume boundaries.
>
> > > It might help to have the fh in statx, since that's easier on the
> > > userspace programmer than having to deal with two interfaces (i_ino
> > > won't go away for some time, because of backward compatibility).
> > > OTOH I also don't like the way it would need to be shoehorned into
> > > statx.
> >
> > No, it really doesn't belong into statx().
> >
> > And besides, the file handle apis name_to_handle_at() are already
> > in wider use than a lot of people think. Not just for the exportfs case
> > but also for example, cgroupfs uses file handles to provide unique
> > identifiers for cgroups that can be compared.
>
> The issue with name_to_handle_at() is its use of the old, non-unique
> mount ID. Yes, yes, we can get away with
>
> fd = openat(dfd, path, O_PATH);
> name_to_handle_at(fd, "", ..., AT_EMPTY_PATH);
> statx(fd, "", AT_EMPTY_PATH, STATX_MNT_ID_UNIQUE, ...);
> close(fd);
>
> But that's *four* syscalls instead of one...
Yeah, but putting this into statx() isn't really nice imho. Once we do
actually land the unique mount id thing it wouldn't be the worst thing
to add name_to_handle_at2().
next prev parent reply other threads:[~2023-12-12 15:24 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20231208024919.yjmyasgc76gxjnda@moria.home.lan>
[not found] ` <630fcb48-1e1e-43df-8b27-a396a06c9f37@molgen.mpg.de>
[not found] ` <20231208200247.we3zrwmnkwy5ibbz@moria.home.lan>
[not found] ` <170233460764.12910.276163802059260666@noble.neil.brown.name>
[not found] ` <20231211233231.oiazgkqs7yahruuw@moria.home.lan>
[not found] ` <170233878712.12910.112528191448334241@noble.neil.brown.name>
[not found] ` <20231212000515.4fesfyobdlzjlwra@moria.home.lan>
[not found] ` <170234279139.12910.809452786055101337@noble.neil.brown.name>
[not found] ` <ZXf1WCrw4TPc5y7d@dread.disaster.area>
[not found] ` <CAOQ4uxiQcOk1Kw1JX4602vjuWNfL=b_A3uB1FJFaHQbEX6OOMA@mail.gmail.com>
2023-12-12 8:56 ` file handle in statx (was: Re: How to cope with subvolumes and snapshots on muti-user systems?) Christian Brauner
2023-12-12 9:10 ` David Howells
2023-12-12 9:23 ` Christian Brauner
2023-12-12 9:28 ` Miklos Szeredi
2023-12-12 9:35 ` Christian Brauner
2023-12-12 9:42 ` Miklos Szeredi
2023-12-12 13:47 ` Christian Brauner
2023-12-12 14:06 ` Miklos Szeredi
2023-12-12 15:24 ` Christian Brauner [this message]
2023-12-12 15:28 ` Kent Overstreet
2023-12-12 9:46 ` David Howells
2023-12-12 15:16 ` Kent Overstreet
2023-12-12 15:29 ` Christian Brauner
2023-12-12 15:35 ` Kent Overstreet
2023-12-12 15:38 ` Miklos Szeredi
2023-12-12 15:43 ` Kent Overstreet
2023-12-12 15:57 ` Miklos Szeredi
2023-12-12 16:08 ` Kent Overstreet
2023-12-12 16:30 ` Miklos Szeredi
2023-12-12 16:41 ` Kent Overstreet
2023-12-12 21:53 ` NeilBrown
2023-12-13 9:41 ` Christian Brauner
2023-12-12 21:46 ` NeilBrown
2023-12-13 9:47 ` Christian Brauner
2023-12-13 10:04 ` Christian Brauner
2023-12-14 22:47 ` NeilBrown
2023-12-15 0:36 ` Kent Overstreet
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=20231212-untiefen-leihwagen-ca303230fc4e@brauner \
--to=brauner@kernel.org \
--cc=amir73il@gmail.com \
--cc=buczek@molgen.mpg.de \
--cc=david@fromorbit.com \
--cc=dhowells@redhat.com \
--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=miklos@szeredi.hu \
--cc=neilb@suse.de \
--cc=stefan.krueger@aei.mpg.de \
/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