linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] fhandle, pidfs: allow open_by_handle_at() purely based on file handle
@ 2025-06-23  9:01 Christian Brauner
  2025-06-23  9:01 ` [PATCH 1/9] fhandle: raise FILEID_IS_DIR in handle_type Christian Brauner
                   ` (8 more replies)
  0 siblings, 9 replies; 33+ messages in thread
From: Christian Brauner @ 2025-06-23  9:01 UTC (permalink / raw)
  To: Jeff Layton, Chuck Lever, Jan Kara, Amir Goldstein, Simona Vetter
  Cc: linux-fsdevel, linux-nfs, Christian Brauner, stable

Various filesystems such as pidfs and drm support opening file handles
without having to require a file descriptor to identify the filesystem.
The filesystem are global single instances and can be trivially
identified solely on the information encoded in the file handle.

This makes it possible to not have to keep or acquire a sentinal file
descriptor just to pass it to open_by_handle_at() to identify the
filesystem. That's especially useful when such sentinel file descriptor
cannot or should not be acquired.

For pidfs this means a file handle can function as full replacement for
storing a pid in a file. Instead a file handle can be stored and
reopened purely based on the file handle.

Such autonomous file handles can be opened with or without specifying a
sentinal file descriptor. Userspace can trivially test for support by
trying to open the file handle with an invalid file descriptor.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
Christian Brauner (9):
      fhandle: raise FILEID_IS_DIR in handle_type
      fhandle: hoist copy_from_user() above get_path_from_fd()
      fhandle: rename to get_path_anchor()
      pidfs: add pidfs_root_path() helper
      fhandle: reflow get_path_anchor()
      exportfs: add FILEID_PIDFS
      fhandle: add EXPORT_OP_AUTONOMOUS_HANDLES marker
      fhandle, pidfs: support open_by_handle_at() purely based on file handle
      selftests/pidfd: decode pidfd file handles withou having to specify an fd

 fs/fhandle.c                                       | 79 +++++++++++++---------
 fs/internal.h                                      |  1 +
 fs/pidfs.c                                         | 16 ++++-
 include/linux/exportfs.h                           | 15 +++-
 tools/testing/selftests/pidfd/Makefile             |  2 +-
 .../selftests/pidfd/pidfd_file_handle_test.c       | 54 +++++++++++++++
 6 files changed, 133 insertions(+), 34 deletions(-)
---
base-commit: 1ff46043a6745d56b37acfc888d6e2b4f4d90663
change-id: 20250619-work-pidfs-fhandle-b63ff35c4924


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2025-06-24  8:25 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-23  9:01 [PATCH 0/9] fhandle, pidfs: allow open_by_handle_at() purely based on file handle Christian Brauner
2025-06-23  9:01 ` [PATCH 1/9] fhandle: raise FILEID_IS_DIR in handle_type Christian Brauner
2025-06-23 11:31   ` Jan Kara
2025-06-23  9:01 ` [PATCH 2/9] fhandle: hoist copy_from_user() above get_path_from_fd() Christian Brauner
2025-06-23 11:33   ` Jan Kara
2025-06-23  9:01 ` [PATCH 3/9] fhandle: rename to get_path_anchor() Christian Brauner
2025-06-23 11:34   ` Jan Kara
2025-06-23  9:01 ` [PATCH 4/9] pidfs: add pidfs_root_path() helper Christian Brauner
2025-06-23 11:46   ` Jan Kara
2025-06-23  9:01 ` [PATCH 5/9] fhandle: reflow get_path_anchor() Christian Brauner
2025-06-23 11:39   ` Jan Kara
2025-06-23  9:01 ` [PATCH 6/9] exportfs: add FILEID_PIDFS Christian Brauner
2025-06-23 11:55   ` Jan Kara
2025-06-23 11:58     ` Christian Brauner
2025-06-23 12:22       ` Amir Goldstein
2025-06-23 12:41         ` Jan Kara
2025-06-23 13:05           ` Amir Goldstein
2025-06-23 13:18             ` Jan Kara
2025-06-23 14:05               ` Amir Goldstein
2025-06-23 19:17                 ` Christian Brauner
2025-06-24  8:25                   ` Christian Brauner
2025-06-23  9:01 ` [PATCH 7/9] fhandle: add EXPORT_OP_AUTONOMOUS_HANDLES marker Christian Brauner
2025-06-23 11:58   ` Jan Kara
2025-06-23 12:37     ` Amir Goldstein
2025-06-23  9:01 ` [PATCH 8/9] fhandle, pidfs: support open_by_handle_at() purely based on file handle Christian Brauner
2025-06-23 12:06   ` Jan Kara
2025-06-23 12:25     ` Christian Brauner
2025-06-23 12:54       ` Amir Goldstein
2025-06-23 13:00         ` Christian Brauner
2025-06-23 13:21           ` Jan Kara
2025-06-23 14:00             ` Amir Goldstein
2025-06-23 13:29       ` Jan Kara
2025-06-23  9:01 ` [PATCH 9/9] selftests/pidfd: decode pidfd file handles withou having to specify an fd Christian Brauner

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 NNTP newsgroup(s).