Re: [PATCH v7 13/20] nfs: implement client support for NFS_LOCALIO_PROGRAM

Mike Snitzer
2024-06-26T16:45:42Z

On Wed, Jun 26, 2024 at 09:21:00AM +1000, NeilBrown wrote:
> On Tue, 25 Jun 2024, Mike Snitzer wrote:
> > LOCALIOPROC_GETUUID allows a client to discover the server's uuid.
> >
> > nfs_local_probe() will retrieve server's uuid via LOCALIO protocol and
> > verify the server with that uuid it is known to be local. This ensures
> > client and server 1: support localio 2: are local to each other.
> >
> > All the knowledge of the LOCALIO RPC protocol is in fs/nfs/localio.c
> > which implements just a single version (1) that is used independently
> > of what NFS version is used.
> >
> > Get nfsd_open_local_fh and store it in rpc_client during client
> > creation, put the symbol during nfs_local_disable -- which is also
> > called during client destruction.
> >
> > Signed-off-by: Mike Snitzer <snitzer@kernel.org>
> > [neilb: factored out and simplified single localio protocol]
> > Co-developed-by: NeilBrown <neilb@suse.de>
> > Signed-off-by: NeilBrown <neilb@suse.de>
> > ---
> > fs/nfs/client.c | 6 +-
> > fs/nfs/localio.c | 159 +++++++++++++++++++++++++++++++++++++++++---
> > include/linux/nfs.h | 7 ++
> > 3 files changed, 161 insertions(+), 11 deletions(-)
> >
> > diff --git a/fs/nfs/client.c b/fs/nfs/client.c
> > index 1300c388f971..6faa9fdc444d 100644
> > --- a/fs/nfs/client.c
> > +++ b/fs/nfs/client.c
> > @@ -434,8 +434,10 @@ struct nfs_client *nfs_get_client(const struct nfs_client_initdata *cl_init)
> > list_add_tail(&new->cl_share_link,
> > &nn->nfs_client_list);
> > spin_unlock(&nn->nfs_client_lock);
> > - nfs_local_probe(new);
> > - return rpc_ops->init_client(new, cl_init);
> > + new = rpc_ops->init_client(new, cl_init);
> > + if (!IS_ERR(new))
> > + nfs_local_probe(new);
> > + return new;
>
> I would fold this back into the earlier patch that introduced
> nfs_local_probe(). It makes this patch ugly.
> But I won't insist.

I cleaned it up a bit so that this patch is cleaner, but I'd prefer to
leave it split out.

Thanks.
Mike