fs: support O_PATH fds with FSCONFIG_SET_FD
authorChristian Brauner <brauner@kernel.org>
Mon, 10 Feb 2025 12:38:59 +0000 (13:38 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 12 Feb 2025 09:02:10 +0000 (10:02 +0100)
commit0ff053b98a0f039e52c2bd8d0cb38f2831edfaf5
tree2f2a5fd968924846c8c05746512abed23ae15ff2
parent2cc0b7fd4bb0cd7f98fe75758e4c619f74873bd9
fs: support O_PATH fds with FSCONFIG_SET_FD

Let FSCONFIG_SET_FD handle O_PATH file descriptors. This is particularly
useful in the context of overlayfs where layers can be specified via
file descriptors instead of paths. But userspace must currently use
non-O_PATH file desriptors which is often pointless especially if
the file descriptors have been created via open_tree(OPEN_TREE_CLONE).

Link: https://lore.kernel.org/r/20250210-work-overlayfs-v2-1-ed2a949b674b@kernel.org
Fixes: a08557d19ef41 ("ovl: specify layers via file descriptors")
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/autofs/autofs_i.h
fs/fsopen.c