Linux-api Archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>, Miklos Szeredi <miklos@szeredi.hu>,
	Jeff Layton <jlayton@kernel.org>,
	Chuck Lever <chuck.lever@oracle.com>,
	linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org,
	linux-nfs@vger.kernel.org, linux-api@vger.kernel.org,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH v2 3/4] exportfs: allow exporting non-decodeable file handles to userspace
Date: Thu, 4 May 2023 14:37:38 +0300	[thread overview]
Message-ID: <CAOQ4uxh4Kij7fMyFOMgdnZee5_HcHc9RYTNxvLTBtD-JxpCZwQ@mail.gmail.com> (raw)
In-Reply-To: <20230504-unruhen-lauftraining-d676c7702fea@brauner>

On Thu, May 4, 2023 at 2:19 PM Christian Brauner <brauner@kernel.org> wrote:
>
> On Wed, May 03, 2023 at 07:23:14PM +0200, Jan Kara wrote:
> > On Tue 02-05-23 15:48:16, Amir Goldstein wrote:
> > > Some userspace programs use st_ino as a unique object identifier, even
> > > though inode numbers may be recycable.
> > >
> > > This issue has been addressed for NFS export long ago using the exportfs
> > > file handle API and the unique file handle identifiers are also exported
> > > to userspace via name_to_handle_at(2).
> > >
> > > fanotify also uses file handles to identify objects in events, but only
> > > for filesystems that support NFS export.
> > >
> > > Relax the requirement for NFS export support and allow more filesystems
> > > to export a unique object identifier via name_to_handle_at(2) with the
> > > flag AT_HANDLE_FID.
> > >
> > > A file handle requested with the AT_HANDLE_FID flag, may or may not be
> > > usable as an argument to open_by_handle_at(2).
> > >
> > > To allow filesystems to opt-in to supporting AT_HANDLE_FID, a struct
> > > export_operations is required, but even an empty struct is sufficient
> > > for encoding FIDs.
> >
> > Christian (or Al), are you OK with sparing one AT_ flag for this
> > functionality? Otherwise the patch series looks fine to me so I'd like to
> > queue it into my tree. Thanks!
>
> At first it looked like there are reasons to complain about this on the
> grounds that this seems like a flag only for a single system call. But
> another look at include/uapi/linux/fcntl.h reveals that oh well, the
> AT_* flag namespace already contains system call specific flags.
>
> The overloading of AT_EACCESS and AT_REMOVEDIR as 0x200 is especially
> creative since it doesn't even use an infix like the statx specific
> flags.
>
> Long story short, since there's already overloading of the flag
> namespace happening it wouldn't be unprecedent or in any way wrong if
> this patch just reused the 0x200 value as well.
>

I had considered this myself as well...
Couldn't decide if this was ugly or not.
Obviously, I do not mind which value the flag gets.

> In fact, it might come in handy since it would mean that we have the bit
> you're using right now free for a flag that is meaningful for multiple
> system calls. So something to consider but you can just change that
> in-tree as far as I'm concerned.
>
> All this amounts to a long-winded,
>
> Acked-by: Christian Brauner <brauner@kernel.org>

Thanks,
Amir.

  reply	other threads:[~2023-05-04 11:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 12:48 [PATCH v2 0/4] Prepare for supporting more filesystems with fanotify Amir Goldstein
2023-05-02 12:48 ` [PATCH v2 1/4] exportfs: change connectable argument to bit flags Amir Goldstein
2023-05-02 12:48 ` [PATCH v2 2/4] exportfs: add explicit flag to request non-decodeable file handles Amir Goldstein
2023-05-02 12:48 ` [PATCH v2 3/4] exportfs: allow exporting non-decodeable file handles to userspace Amir Goldstein
2023-05-03 17:23   ` Jan Kara
2023-05-04 11:19     ` Christian Brauner
2023-05-04 11:37       ` Amir Goldstein [this message]
2023-05-02 12:48 ` [PATCH v2 4/4] fanotify: support reporting non-decodeable file handles Amir Goldstein

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=CAOQ4uxh4Kij7fMyFOMgdnZee5_HcHc9RYTNxvLTBtD-JxpCZwQ@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jack@suse.cz \
    --cc=jlayton@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --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 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 read-only IMAP folder(s) and NNTP newsgroup(s).