Re: [PATCH 0/4] exportfs: add flag to allow marking export operations as only supporting file handles

Christoph Hellwig
2024-12-09T13:46:57Z

On Mon, Dec 09, 2024 at 09:58:58AM +0100, Amir Goldstein wrote:
> To be clear, exporting pidfs or internal shmem via an anonymous fd is
> probably not possible with existing userspace tools, but with all the new
> mount_fd and magic link apis, I can never be sure what can be made possible
> to achieve when the user holds an anonymous fd.
>
> The thinking behind adding the EXPORT_OP_LOCAL_FILE_HANDLE flag
> was that when kernfs/cgroups was added exportfs support with commit
> aa8188253474 ("kernfs: add exportfs operations"), there was no intention
> to export cgroupfs over nfs, only local to uses, but that was never enforced,
> so we thought it would be good to add this restriction and backport it to
> stable kernels.

Can you please explain what the problem with exporting these file
systems over NFS is? Yes, it's not going to be very useful. But what
is actually problematic about it? Any why is it not problematic with
a userland nfs server? We really need to settle that argumet before
deciding a flag name or polarity.