[PATCH 5/7] nfs: create the /proc/fs/nfsfs links with proc_self_symlink()

Anna Schumaker anna at kernel.org
Mon Oct 26 10:58:34 PDT 2026



On Sat, Oct 24, 2026, at 3:38 AM, Christian Brauner wrote:
> /proc/fs/nfsfs/servers and /proc/fs/nfsfs/volumes resolve through
> /proc/net into /proc/self/net. Create them with proc_self_symlink() so
> nothing can be mounted on the links themselves.

Looks good to me.

Acked-by: Anna Schumaker <anna.schumaker at hammerspace.com>

>
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>
> ---
>  fs/nfs/client.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/nfs/client.c b/fs/nfs/client.c
> index 60386330aeec..97e363ac7a3e 100644
> --- a/fs/nfs/client.c
> +++ b/fs/nfs/client.c
> @@ -1528,11 +1528,11 @@ int __init nfs_fs_proc_init(void)
>  		goto error_0;
> 
>  	/* a file of servers with which we're dealing */
> -	if (!proc_symlink("fs/nfsfs/servers", NULL, "../../net/nfsfs/servers"))
> +	if (!proc_self_symlink("fs/nfsfs/servers", NULL, "../../net/nfsfs/servers"))
>  		goto error_1;
> 
>  	/* a file of volumes that we have mounted */
> -	if (!proc_symlink("fs/nfsfs/volumes", NULL, "../../net/nfsfs/volumes"))
> +	if (!proc_self_symlink("fs/nfsfs/volumes", NULL, "../../net/nfsfs/volumes"))
>  		goto error_1;
> 
>  	return 0;
>
> -- 
> 2.53.0



More information about the linux-afs mailing list