Linux NFS development
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Ricardo Labiaga <ricardo.labiaga@netapp.com>
Cc: NFS list <linux-nfs@vger.kernel.org>,
	pNFS Mailing List <pnfs@linux-nfs.org>
Subject: Re: [pnfs] nfs41: sunrpc: handle clnt==NULL in call_status
Date: Thu, 06 Nov 2008 09:48:43 +0200	[thread overview]
Message-ID: <4912A15B.4070009@panasas.com> (raw)
In-Reply-To: <89EF203E-20FF-4A0B-BE41-FB6A62BE76DA@netapp.com>

On Nov. 06, 2008, 9:19 +0200, Ricardo Labiaga <ricardo.labiaga@netapp.com> wrote:
> On Nov 5, 2008, at 7:05 PM, Labiaga, Ricardo wrote:
> 
>>>>>> Signed-off-by: Benny Halevy <bhalevy@panasas.com>
>>>>>> ---
>>>>>>
>>>>>> Trond, I'm not sure if this can happen without nfs41.
>>>>>> However, please consider this patch for upstream since
>>>>>> it is safe to do in any case.
>>>>>>
>>>>>> Benny
>>>>>>
>>>>>> net/sunrpc/clnt.c |    8 +++++---
>>>>>> 1 files changed, 5 insertions(+), 3 deletions(-)
>>>>>>
>>>>>> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
>>>>>> index 78fc483..b555d9f 100644
>>>>>> --- a/net/sunrpc/clnt.c
>>>>>> +++ b/net/sunrpc/clnt.c
>>>>>> @@ -1206,7 +1206,8 @@ call_status(struct rpc_task *task)
>>>>>> 		break;
>>>>>> 	case -ECONNREFUSED:
>>>>>> 	case -ENOTCONN:
>>>>>> -		rpc_force_rebind(clnt);
>>>>>> +		if (clnt)
>>>>>> +			rpc_force_rebind(clnt);
>>>>>> 		task->tk_action = call_bind;
>>>>>> 		break;
>>>>>> 	case -EAGAIN:
>>>>>> @@ -1217,9 +1218,10 @@ call_status(struct rpc_task *task)
>>>>>> 		rpc_exit(task, status);
>>>>>> 		break;
>>>>>> 	default:
>>>>>> -		if (clnt->cl_chatty)
>>>>>> +		if (!clnt || clnt->cl_chatty)
>>>>>> 			printk("%s: RPC call returned error %d\n",
>>>>>> -			       clnt->cl_protname, -status);
>>>>>> +			       clnt ? clnt->cl_protname : "<unknown
>>>> protocol>",
>>>>>> +			       -status);
>>>>>> 		rpc_exit(task, status);
>>>>>> 	}
>>>>>> }
>>>>> BIG NACK!
>>>>>
>>>>> How does even it make sense for a task to get past call_transmit
>> and
>>>>> call_status without having task->tk_client set? This sounds like
>>>> serious
>>>>> borkenness in the nfsv4.1 patches...
>>> Ricardo,
>>>
>>> rpc_run_bc_task sets no task_setup_data.rpc_client when calling
>>> rpc_new_task.
>>> We might be able to use to fore channel rpc client,
>> We could, though it would cause the reconnection to occur in the
>> backchannel code path.  Haven't thought it through, but it sounds
>> cleaner to rebind the session (or reset it if the server went away) in
>> the forechannel context.  I wonder if it would be acceptable to simply
>> drop the backchannel request, and have the forechannel reestablish the
>> connection (on a retransmission)?
>>
>>> but
>>> I'm still concerned that using this path for sending the callback
>>> replies is wrong.
>> The mainline RPC call_transmit() is already able to deal with RPC
>> transmissions that don't expect a reply.  This is pretty similar to
>> sending a reply, so we're leveraging the existing rpc_xprt.
>>
>> One alternative could be to construct an svc_xprt for the backchannel
>> and use svc_send() for the reply.  I wonder if it's really a better
>> approach since we already have the rpc_xprt available.
> 
> I failed to mention that with the existing approach we're able to  
> synchronize forechannel calls and backchannel replies on the rpc_xprt  
> (XPRT_LOCKED bit).  It uses the synchronization mechanism already in  
> mainline to prevent mixing the payload of requests and replies.

Right, but we need to do this at the xprt layer.  I don't think that
this mandates starting the reply process from the rpc layer
as we do today in bc_send.

Note that bc_svc_process gets both an rpc_rqst and a svc_rqst.
Although we forge a svc_rqst including setting up its rq_xprt
which is a svc_xprt, I'm not sure what exactly it is used for.
Eventually, we end up sending the reply (via bc_send) using
the rpc_rqst and its associated rpc_xprt.  This will allow
us to synchronize properly on the bi-directional channel.

> 
> - ricardo
> 

[snip]

  reply	other threads:[~2008-11-06  7:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-04 15:52 nfs41: sunrpc: handle clnt==NULL in call_status Benny Halevy
2008-11-04 16:09 ` [pnfs] " Peter Staubach
2008-11-05 13:20   ` Benny Halevy
2008-11-04 18:19 ` Trond Myklebust
     [not found]   ` <1225822763.30407.6.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2008-11-04 21:24     ` Labiaga, Ricardo
     [not found]       ` <273FE88A07F5D445824060902F70034402974728-hX7t0kiaRRpT+ZUat5FNkAK/GNPrWCqfQQ4Iyu8u01E@public.gmane.org>
2008-11-05  0:43         ` [pnfs] " Tom Tucker
2008-11-05  2:40           ` Labiaga, Ricardo
     [not found]             ` <273FE88A07F5D445824060902F700344029749C8-hX7t0kiaRRpT+ZUat5FNkAK/GNPrWCqfQQ4Iyu8u01E@public.gmane.org>
2008-11-05 16:53               ` Chuck Lever
2008-11-05 18:05                 ` Tom Tucker
     [not found]                   ` <3682CC68-8C61-472B-8D75-B19F31576428@oracle.com>
2008-11-05 18:52                     ` Talpey, Thomas
2008-11-05 18:08                 ` Trond Myklebust
2008-11-05 17:59               ` Tom Tucker
2008-11-05 13:12         ` Benny Halevy
2008-11-06  3:05           ` Labiaga, Ricardo
     [not found]             ` <273FE88A07F5D445824060902F70034402975078-hX7t0kiaRRpT+ZUat5FNkAK/GNPrWCqfQQ4Iyu8u01E@public.gmane.org>
2008-11-06  7:19               ` [pnfs] " Ricardo Labiaga
2008-11-06  7:48                 ` Benny Halevy [this message]
2008-11-07  2:41                   ` Labiaga, Ricardo
2008-11-07 11:23                     ` Halevy, Benny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4912A15B.4070009@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=pnfs@linux-nfs.org \
    --cc=ricardo.labiaga@netapp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox