public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Thomas Bertschinger <tahbertschinger@gmail.com>,
	 Jens Axboe <axboe@kernel.dk>,
	io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	 viro@zeniv.linux.org.uk, linux-nfs@vger.kernel.org
Subject: Re: [PATCHSET RFC 0/6] add support for name_to, open_by_handle_at(2) to io_uring
Date: Thu, 21 Aug 2025 09:47:41 +0200	[thread overview]
Message-ID: <20250821-putzig-bockig-ad93ba46e12e@brauner> (raw)
In-Reply-To: <CAOQ4uximiUryMV=z_3TrEN1KCSA-2YdCt0t7v1M1gRZpnWec=Q@mail.gmail.com>

On Wed, Aug 20, 2025 at 09:58:15PM +0200, Amir Goldstein wrote:
> On Wed, Aug 20, 2025 at 5:00 PM Thomas Bertschinger
> <tahbertschinger@gmail.com> wrote:
> >
> > On Wed Aug 20, 2025 at 2:34 AM MDT, Amir Goldstein wrote:
> > > On Wed, Aug 20, 2025 at 4:57 AM Thomas Bertschinger
> > > <tahbertschinger@gmail.com> wrote:
> > >> Any thoughts on that? This seemed to me like there wasn't an obvious
> > >> easy solution, hence why I just didn't attempt it at all in v1.
> > >> Maybe I'm missing something, though.
> > >>
> > >
> > > Since FILEID_IS_CONNECTABLE, we started using the high 16 bits of
> > > fh_type for FILEID_USER_FLAGS, since fs is not likely expecting a fh_type
> > > beyond 0xff (Documentation/filesystems/nfs/exporting.rst):
> > > "A filehandle fragment consists of an array of 1 or more 4byte words,
> > > together with a one byte "type"."
> > >
> > > The name FILEID_USER_FLAGS may be a bit misleading - it was
> > > never the intention for users to manipulate those flags, although they
> > > certainly can and there is no real harm in that.
> > >
> > > These flags are used in the syscall interface only, but
> > > ->fh_to_{dentry,parent}() function signature also take an int fh_flags
> > > argument, so we can use that to express the non-blocking request.
> > >
> > > Untested patch follows (easier than explaining):
> >
> > Ah, that makes sense and makes this seem feasible. Thanks for pointing
> > that out!
> >
> > It also seems that each FS could opt in to this with a new EXPORT_OP
> > flag so that the FSes that want to support this can be updated
> > individually. Then, updating most or every exportable FS isn't a
> > requirement for this.
> 
> Makes a lot of sense. yes.
> 
> >
> > Do you have an opinion on that, versus expecting every ->fh_to_dentry()
> > implementation to respect the new flag?
> 
> Technically, you do not need every fs to respect this flag, you only need them
> to not ignore it.
> 
> Generally, if you pass (fileid_type | EXPORT_FH_CACHED) as the type
> argument, most filesystems will not accept this value anyway and return
> NULL or PTR_ERR(-ESTALE), so not ignoring.
> 
> But I think it is much preferred to check the opt-in EXPORT_OP
> flag and return EAGAIN from generic code in the case that fs does
> not support non-blocking decode.
> 
> And fs that do opt in should probably return PTR_ERR(-EAGAIN)
> when the file type is correct but non-blocking decode is not possible.

I like your idea as it's in line with other extensions we've done
recently to open_by_handle_at().

      reply	other threads:[~2025-08-21  7:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 23:54 [PATCHSET RFC 0/6] add support for name_to, open_by_handle_at(2) to io_uring Thomas Bertschinger
2025-08-14 23:54 ` [PATCH 1/6] fhandle: create helper for name_to_handle_at(2) Thomas Bertschinger
2025-08-15 10:21   ` Amir Goldstein
2025-08-15 18:17     ` Thomas Bertschinger
2025-08-14 23:54 ` [PATCH 2/6] io_uring: add support for IORING_OP_NAME_TO_HANDLE_AT Thomas Bertschinger
2025-08-15 10:40   ` Amir Goldstein
2025-08-16  7:43   ` kernel test robot
2025-08-14 23:54 ` [PATCH 3/6] fhandle: do_handle_open() should get FD with user flags Thomas Bertschinger
2025-08-15  9:17   ` Amir Goldstein
2025-08-15 13:46     ` Christian Brauner
2025-08-15 13:51       ` Amir Goldstein
2025-08-19  9:43         ` Christian Brauner
2025-08-15 13:47   ` (subset) " Christian Brauner
2025-08-14 23:54 ` [PATCH 4/6] fhandle: create __do_handle_open() helper Thomas Bertschinger
2025-08-15 10:33   ` Amir Goldstein
2025-08-14 23:54 ` [PATCH 5/6] io_uring: add __io_open_prep() helper Thomas Bertschinger
2025-08-14 23:54 ` [PATCH 6/6] io_uring: add support for IORING_OP_OPEN_BY_HANDLE_AT Thomas Bertschinger
2025-08-16 10:10   ` kernel test robot
2025-08-15  9:52 ` [PATCHSET RFC 0/6] add support for name_to, open_by_handle_at(2) to io_uring Amir Goldstein
2025-08-15 18:24   ` Thomas Bertschinger
2025-08-19 15:11 ` Jens Axboe
2025-08-20  3:01   ` Thomas Bertschinger
2025-08-20  8:34     ` Amir Goldstein
2025-08-20 15:05       ` Thomas Bertschinger
2025-08-20 19:58         ` Amir Goldstein
2025-08-21  7:47           ` Christian Brauner [this message]

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=20250821-putzig-bockig-ad93ba46e12e@brauner \
    --to=brauner@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=tahbertschinger@gmail.com \
    --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