public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Bian Naimeng <biannm@cn.fujitsu.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org, "J. Bruce Fields" <bfields@fieldses.org>
Subject: Re: [PATCH]rpc client can not deal with ENOSOCK, so translate it into ENOCONN
Date: Mon, 08 Mar 2010 09:13:04 +0800	[thread overview]
Message-ID: <4B944F20.9080205@cn.fujitsu.com> (raw)
In-Reply-To: <1267885392.4688.5.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>



Trond Myklebust =8E=CA=93=B9:
> On Sat, 2010-03-06 at 11:46 +0800, Bian Naimeng wrote:=20
>> If NFSv4 client send a request before connect, or the old connection=
 was broken
>> because a ETIMEOUT error catched by call_status, ->send_request will=
 return
>> ENOSOCK, but rpc layer can not deal with it, so translate it into EN=
OCONN.
>>
>> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
>>
>> ---

=2E.. snip...

>> -	if (!transport->sock)
>> +	if (!transport->sock || status =3D=3D -ENOTSOCK) {
>> +		/* Should we call xs_close() here? */
>> +		status =3D -ENOTCONN;
>>  		goto out;
>> +	}
>> =20
>>  	switch (status) {
>> -	case -ENOTSOCK:
>> -		status =3D -ENOTCONN;
>> -		/* Should we call xs_close() here? */
>> -		break;
>>  	case -EAGAIN:
>>  		status =3D xs_nospace(task);
>>  		break;
>=20
> The only case where xs_sendpages() will return ENOTSOCK is if
> transport->sock =3D=3D NULL, so the correct fix here is to just remov=
e that
> redundant test. There is no need to move the test for ENOTSOCK out of
> the switch statement.

  Yes. Thanks for your suggestion.

  Best Regards
   Bian

>=20
> Cheers
>   Trond


  parent reply	other threads:[~2010-03-08  1:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-06  3:46 [PATCH]rpc client can not deal with ENOSOCK, so translate it into ENOCONN Bian Naimeng
     [not found] ` <1267885392.4688.5.camel@localhost.localdomain>
     [not found]   ` <1267885392.4688.5.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-03-08  1:13     ` Bian Naimeng [this message]
2010-03-08  1:13     ` [PATCH][V2]rpc " Bian Naimeng
2010-03-08  6:49       ` [PATCH][V3]rpc " Bian Naimeng

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=4B944F20.9080205@cn.fujitsu.com \
    --to=biannm@cn.fujitsu.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    /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