[pnfs] [PATCH] Get NFSv4 client to work with NFSv4.1 server.

Benny Halevy bhalevy at panasas.com
Sun Aug 26 04:53:05 EDT 2007


I'm confused... the only place nfsd41_set_clientid is called
is in nfsd4_open() for minorversion 1 opens (which also
makes me doubt the need for this tiny static function)

Benny

Marc Eshel wrote:
> From: Marc Eshel <eshel at almaden.ibm.com>
> 
> 
> ---
> 
>  fs/nfsd/nfs4proc.c         |   15 +++++++++++++--
>  include/linux/nfsd/state.h |    1 +
>  2 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index f90ea73..89eaeef 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -219,8 +219,18 @@ do_open_fhandle(struct svc_rqst *rqstp, 
>  static void
>  nfsd41_set_clientid(clientid_t *clid, struct current_session *cses)
>  {
> -	clid->cl_boot = cses->cs_sid.clientid.cl_boot;
> -	clid->cl_id = cses->cs_sid.clientid.cl_id;
> +	dprintk("nfsd41_set_clientid ver %d clid %08x/%08x csid %08x/%08x\n",
> +			cses->cs_version, clid->cl_boot, clid->cl_id,
> +			cses->cs_sid.clientid.cl_boot,
> +			cses->cs_sid.clientid.cl_id);
> +	if (cses->cs_version > 0) {
> +		clid->cl_boot = cses->cs_sid.clientid.cl_boot;
> +		clid->cl_id = cses->cs_sid.clientid.cl_id;
> +	}
> +	else {
> +		cses->cs_sid.clientid.cl_boot = clid->cl_boot;
> +		cses->cs_sid.clientid.cl_id = clid->cl_id;
> +	}
>  }
>  
>  static inline int
> @@ -1133,6 +1143,7 @@ #if defined(CONFIG_NFSD_V4_1)
>  	current_ses = kzalloc(sizeof(*current_ses), GFP_KERNEL);
>  	if (current_ses == NULL)
>  		goto out;
> +	current_ses->cs_version = args->minorversion;
>  #endif
>  
>  	resp->xbuf = &rqstp->rq_res;
> diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
> index d6b5287..e6816df 100644
> --- a/include/linux/nfsd/state.h
> +++ b/include/linux/nfsd/state.h
> @@ -180,6 +180,7 @@ nfs41_get_session(struct nfs41_session *
>  
>  struct current_session {
>  	nfsd_sessionid_t	cs_sid;
> +	u32			cs_version;
>  	struct nfs41_slot	*cs_slot;
>  };
>  
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs



More information about the pNFS mailing list