From: Thomas Bertschinger <tahbertschinger@gmail.com>
To: io-uring@vger.kernel.org, axboe@kernel.dk,
linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk,
brauner@kernel.org, linux-nfs@vger.kernel.org
Cc: Thomas Bertschinger <tahbertschinger@gmail.com>,
linux-xfs@vger.kernel.org, cem@kernel.org,
chuck.lever@oracle.com, jlayton@kernel.org
Subject: [PATCHSET RFC v2 00/10] add support for name_to, open_by_handle_at() to io_uring
Date: Wed, 10 Sep 2025 15:49:17 -0600 [thread overview]
Message-ID: <20250910214927.480316-1-tahbertschinger@gmail.com> (raw)
This series adds support for name_to_handle_at() and open_by_handle_at()
to io_uring. The idea is for these opcodes to be useful for userspace
NFS servers that want to use io_uring.
The biggest change since [v1] is that this adds support for attempting
non-blocking open_by_handle_at(). When io_uring calls handle_to_path(),
it will set a flag to request that the call return -EAGAIN if it cannot
complete using cached data.
The same holds for the call to do_filp_path_open().
Supporting this for handle_to_path() requires a way to communicate to
the filesystem that it should not block in its fh_to_dentry()
implementation. This is done with a new flag FILEID_CACHED which is set
in the file handle by the VFS. If a filesystem supports this new flag,
it will indicate that with a new flag EXPORT_OP_NONBLOCK so that the VFS
knows not to call into a filesystem with the FILEID_CACHED flag, when
the FS does not know about that flag.
Support for the new FILEID_CACHED flag is added for xfs.
Thanks to Amir Goldstein for the review comments and suggesting this
approach on v1.
Testing
=======
As in v1, a liburing branch with a test is available at
https://github.com/bertschingert/liburing/tree/open_by_handle_at
and is run with
$ ./test/open_by_handle_at.t
v1 -> v2:
- rename some new helper functions:
- do_name_to_handle_at() -> do_sys_name_to_handle_at()
- __do_handle_open() -> do_filp_path_open()
- create a union member name_to_handle_flags in struct io_uring_sqe
- add new FILEID_CACHED and EXPORT_OP_NONBLOCK flags
- attempt non-blocking open_by_handle_at() in io_uring first, rather
than always giving up and running in async context
- add support for FILEID_CACHED in xfs
[v1] https://lore.kernel.org/linux-fsdevel/20250814235431.995876-1-tahbertschinger@gmail.com/
Thomas Bertschinger (10):
fhandle: create helper for name_to_handle_at(2)
io_uring: add support for IORING_OP_NAME_TO_HANDLE_AT
fhandle: helper for allocating, reading struct file_handle
fhandle: create do_filp_path_open() helper
fhandle: make do_filp_path_open() take struct open_flags
exportfs: allow VFS flags in struct file_handle
exportfs: new FILEID_CACHED flag for non-blocking fh lookup
io_uring: add __io_open_prep() helper
io_uring: add support for IORING_OP_OPEN_BY_HANDLE_AT
xfs: add support for non-blocking fh_to_dentry()
fs/exportfs/expfs.c | 15 ++-
fs/fhandle.c | 156 ++++++++++++++++-----------
fs/internal.h | 13 +++
fs/xfs/xfs_export.c | 32 ++++--
fs/xfs/xfs_export.h | 3 +-
fs/xfs/xfs_handle.c | 2 +-
include/linux/exportfs.h | 34 +++++-
include/uapi/linux/io_uring.h | 3 +
io_uring/opdef.c | 26 +++++
io_uring/openclose.c | 191 ++++++++++++++++++++++++++++++++--
io_uring/openclose.h | 13 +++
11 files changed, 405 insertions(+), 83 deletions(-)
base-commit: 76eeb9b8de9880ca38696b2fb56ac45ac0a25c6c
--
2.51.0
next reply other threads:[~2025-09-10 21:46 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 21:49 Thomas Bertschinger [this message]
2025-09-10 21:49 ` [PATCH 01/10] fhandle: create helper for name_to_handle_at(2) Thomas Bertschinger
2025-09-11 12:06 ` Amir Goldstein
2025-09-10 21:49 ` [PATCH 02/10] io_uring: add support for IORING_OP_NAME_TO_HANDLE_AT Thomas Bertschinger
2025-09-10 21:49 ` [PATCH 03/10] fhandle: helper for allocating, reading struct file_handle Thomas Bertschinger
2025-09-11 12:15 ` Amir Goldstein
2025-09-11 15:31 ` Thomas Bertschinger
2025-09-11 15:54 ` Amir Goldstein
2025-09-10 21:49 ` [PATCH 04/10] fhandle: create do_filp_path_open() helper Thomas Bertschinger
2025-09-11 0:53 ` Al Viro
2025-09-11 12:21 ` Amir Goldstein
2025-09-10 21:49 ` [PATCH 05/10] fhandle: make do_filp_path_open() take struct open_flags Thomas Bertschinger
2025-09-10 21:49 ` [PATCH 06/10] exportfs: allow VFS flags in struct file_handle Thomas Bertschinger
2025-09-11 12:24 ` Amir Goldstein
2025-09-10 21:49 ` [PATCH 07/10] exportfs: new FILEID_CACHED flag for non-blocking fh lookup Thomas Bertschinger
2025-09-11 12:31 ` Amir Goldstein
2025-09-12 8:21 ` Dan Carpenter
2025-09-10 21:49 ` [PATCH 08/10] io_uring: add __io_open_prep() helper Thomas Bertschinger
2025-09-10 21:49 ` [PATCH 09/10] io_uring: add support for IORING_OP_OPEN_BY_HANDLE_AT Thomas Bertschinger
2025-09-10 21:49 ` [PATCH 10/10] xfs: add support for non-blocking fh_to_dentry() Thomas Bertschinger
2025-09-11 12:29 ` Christoph Hellwig
2025-09-11 12:39 ` Amir Goldstein
2025-09-11 15:15 ` Thomas Bertschinger
2025-09-11 15:16 ` Amir Goldstein
2025-09-11 12:38 ` 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=20250910214927.480316-1-tahbertschinger@gmail.com \
--to=tahbertschinger@gmail.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=cem@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=io-uring@vger.kernel.org \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--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