[pnfs] [PATCH] nfs41: setup sequence for get_lease_time on rpc_call_validate_args

Benny Halevy bhalevy at panasas.com
Tue Mar 18 14:34:27 EDT 2008


With this patch I'm able to pass all connectathon tests on nfs41-2.6.25.
I will update the public tree accordingly.
Keep in mind that I intend to also re-rework the slot allocation
mechanism as discussed on the mailing list.

Benny

On Mar. 18, 2008, 20:26 +0200, Benny Halevy <bhalevy at panasas.com> wrote:
> setup_sequence should be called from the rpc_call_validate_args,
> not from rpc_call_prepare.
> Also, use nfs4_setup_sequence rather than nfs41_setup_sequence
> to go through session recovery if needed.
> 
> Signed-off-by: Benny Halevy <bhalevy at panasas.com>
> ---
>  fs/nfs/nfs4proc.c |   18 ++++++++++++------
>  1 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 342ac8f..a687e77 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -4473,18 +4473,20 @@ struct nfs4_get_lease_time_data {
>  	struct nfs4_session *session;
>  };
>  
> -static void nfs4_get_lease_time_prepare(struct rpc_task *task,
> +static int nfs4_get_lease_time_validate(struct rpc_task *task,
>  					void *calldata)
>  {
>  	int ret;
>  	struct nfs4_get_lease_time_data *data =
>  			(struct nfs4_get_lease_time_data *)calldata;
>  
> -	ret = nfs41_setup_sequence(data->session,
> -					&data->args->la_seq_args,
> -					&data->res->lr_seq_res, 0, task);
> +	dprintk("--> %s\n", __func__);
> +	ret = nfs4_setup_sequence(data->clp, data->session,
> +				  &data->args->la_seq_args,
> +				  &data->res->lr_seq_res, 0, task);
> +	dprintk("<-- %s return %d\n", __func__, ret);
>  
> -	BUG_ON(ret == -EAGAIN);
> +	return ret;
>  }
>  
>  static void nfs4_get_lease_time_done(struct rpc_task *task,
> @@ -4493,12 +4495,14 @@ static void nfs4_get_lease_time_done(struct rpc_task *task,
>  	struct nfs4_get_lease_time_data *data =
>  			(struct nfs4_get_lease_time_data *)calldata;
>  
> +	dprintk("--> %s\n", __func__);
>  	nfs41_sequence_done(data->clp, data->session,
>  				&data->res->lr_seq_res, task->tk_status);
> +	dprintk("<-- %s\n", __func__);
>  }
>  
>  struct rpc_call_ops nfs4_get_lease_time_ops = {
> -	.rpc_call_prepare = nfs4_get_lease_time_prepare,
> +	.rpc_call_validate_args = nfs4_get_lease_time_validate,
>  	.rpc_call_done = nfs4_get_lease_time_done,
>  };
>  
> @@ -4529,6 +4533,7 @@ int nfs4_proc_get_lease_time(struct nfs_client *clp,
>  	};
>  	int status;
>  
> +	dprintk("--> %s\n", __func__);
>  	task = rpc_run_task(&task_setup);
>  
>  	if (IS_ERR(task))
> @@ -4537,6 +4542,7 @@ int nfs4_proc_get_lease_time(struct nfs_client *clp,
>  		status = task->tk_status;
>  		rpc_put_task(task);
>  	}
> +	dprintk("<-- %s return %d\n", __func__, status);
>  
>  	return status;
>  }



More information about the pNFS mailing list