Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

exportfs: clarify the documentation of open()/permission() expotrfs ops

pidfs and nsfs recently gained support for encode/decode of file handles
via name_to_handle_at(2)/open_by_handle_at(2).

These special kernel filesystems have custom ->open() and ->permission()
export methods, which nfsd does not respect and it was never meant to be
used for exporting those filesystems by nfsd.

Update kernel-doc comments to express the fact the those methods are for
open_by_handle(2) system only and not compatible with nfsd.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://patch.msgid.link/20260129100212.49727-2-amir73il@gmail.com
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Amir Goldstein and committed by
Christian Brauner
a39162f7 b1353865

+10 -2
+10 -2
include/linux/exportfs.h
··· 200 200 * @get_parent: find the parent of a given directory 201 201 * @commit_metadata: commit metadata changes to stable storage 202 202 * 203 + * Methods for open_by_handle(2) syscall with special kernel file systems: 204 + * @permission: custom permission for opening a file by handle 205 + * @open: custom open routine for opening file by handle 206 + * 203 207 * See Documentation/filesystems/nfs/exporting.rst for details on how to use 204 208 * this interface correctly and the definition of the flags. 205 209 * ··· 248 244 * space cannot be allocated, a %ERR_PTR should be returned. 249 245 * 250 246 * @permission: 251 - * Allow filesystems to specify a custom permission function. 247 + * Allow filesystems to specify a custom permission function for the 248 + * open_by_handle_at(2) syscall instead of the default permission check. 249 + * This custom permission function is not respected by nfsd. 252 250 * 253 251 * @open: 254 - * Allow filesystems to specify a custom open function. 252 + * Allow filesystems to specify a custom open function for the 253 + * open_by_handle_at(2) syscall instead of the default file_open_root(). 254 + * This custom open function is not respected by nfsd. 255 255 * 256 256 * @commit_metadata: 257 257 * @commit_metadata should commit metadata changes to stable storage.