[pnfs] [PATCH] pnfs: initialize a new session when cloning nfs_server

William A. (Andy) Adamson andros at citi.umich.edu
Tue May 20 11:28:59 EDT 2008


Sorry if this is a resend...

On Tue, May 20, 2008 at 9:46 AM, Benny Halevy <bhalevy at panasas.com> wrote:

> On May. 20, 2008, 16:27 +0300, andros at netapp.com wrote:
> > From: Andy Adamson <andros at netapp.com>
> >
> > When a struct nfs_server is cloned, create a new session to the server.
> >
> > Signed-off-by: Andy Adamson<andros at netapp.com>
> > ---
> >  fs/nfs/client.c |    8 ++++++++
> >  1 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/fs/nfs/client.c b/fs/nfs/client.c
> > index 9c50be3..9cf6ce4 100644
> > --- a/fs/nfs/client.c
> > +++ b/fs/nfs/client.c
> > @@ -1354,6 +1354,14 @@ struct nfs_server *nfs_clone_server(struct
> nfs_server *source,
> >       if (!IS_ERR(source->client_acl))
> >               nfs_init_server_aclclient(server);
> >
> > +#ifdef CONFIG_NFS_V4_1
> > +     dprintk("%s init new session\n", __func__);
> > +     error = nfs4_init_session(server->nfs_client, &server->session,
> > +                     server->client);
> > +     if (error)
> > +             goto out_free_server;
> > +#endif /* CONFIG_NFS_V4_1 */
> > +
> >       /* probe the filesystem info for this server filesystem */
> >       error = nfs_probe_fsinfo(server, fh, &fattr_fsinfo);
> >       if (error < 0)
>
> 1. nfs4_put_session(&server->session) should be called in out_free_server:


nope.  nfs_free_server calls nfs4_put_session, so it is already called.
But!  I do need to look
at if/when  DESTROY_SESSION is called..


>
> 2. can you please take the init and free parts here out into static inline
> functions that are defined as no-op for !CONFIG_NFS_V4_1, e.g.
> static inline int nfs41_init_server()
> static inline void nfs41_free_server()
>
> Both should also be called from nfs4_create_server similarly.


OK, but that is a separate patch. Please apply this one!

-->Andy

>
>
> Thanks,
>
> Benny
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://linux-nfs.org/pipermail/pnfs/attachments/20080520/a5737bad/attachment.htm 


More information about the pNFS mailing list