mbox series

[RFC,0/2] API for exporting connectable file handles to userspace

Message ID 20240919140611.1771651-1-amir73il@gmail.com (mailing list archive)
Headers show
Series API for exporting connectable file handles to userspace | expand

Message

Amir Goldstein Sept. 19, 2024, 2:06 p.m. UTC
Jeff,

These patches bring the NFS connectable file handles feature to
userspace servers.

They rely on Christian's and Aleksa's changes recently merged to v6.12.

It may not be the best timing for posting RFC patches in the middle of
the merge window and during LPC, but at least this gives you a chance to
gossip about how bad an idea this is with folks ;)

I am aware of the usability implications with connectable file handles,
which are not consistent throughout the inode lifetime (i.e. when moved
to another parent), but the nfsd feature does exists and some users (me)
are interested in exporting this feature to userspace.

The API I chose for encoding conenctable file handles is pretty
conventional (AT_HANDLE_CONNECTABLE).

The API I chose for decoding a connected fd is a bit whacky, but if
you let it sink, it could make sense - my use case is to examine an
object's current path given a previously connectable encoded file handle.

By requesting to open an O_PATH fd, relative to an O_PATH mount_fd,
I would like to get an error (ESTALE) if the path connecting mount_fd
to the would-be-opened fd is unknown.

Thought and flames are welcome.

Thanks,
Amir.


Amir Goldstein (2):
  fs: name_to_handle_at() support for connectable file handles
  fs: open_by_handle_at() support for decoding connectable file handles

 fs/fhandle.c               | 85 +++++++++++++++++++++++++-------------
 include/uapi/linux/fcntl.h |  1 +
 2 files changed, 58 insertions(+), 28 deletions(-)