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

Adamson, Andy William.Adamson at netapp.com
Tue May 20 11:06:41 EDT 2008




-----Original Message-----
From: Benny Halevy [mailto:bhalevy at panasas.com]
Sent: Tue 5/20/2008 9:46 AM
To: Adamson, Andy
Cc: pnfs at linux-nfs.org
Subject: Re: [pnfs] [PATCH] pnfs: initialize a new session when cloning	nfs_server
 
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. it's already called in nfs_free_server. But I do need to investigate 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://linux-nfs.org/pipermail/pnfs/attachments/20080520/57b3cb71/attachment-0001.htm 


More information about the pNFS mailing list