Re: [PATCH]rpc client can not deal with ENOSOCK, so translate it into ENOCONN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Trond Myklebust 写道:
> On Sat, 2010-03-06 at 11:46 +0800, Bian Naimeng wrote: 
>> 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 ENOCONN.
>>
>> Signed-off-by: Bian Naimeng <biannm@xxxxxxxxxxxxxx>
>>
>> ---

... snip...

>> -	if (!transport->sock)
>> +	if (!transport->sock || status == -ENOTSOCK) {
>> +		/* Should we call xs_close() here? */
>> +		status = -ENOTCONN;
>>  		goto out;
>> +	}
>>  
>>  	switch (status) {
>> -	case -ENOTSOCK:
>> -		status = -ENOTCONN;
>> -		/* Should we call xs_close() here? */
>> -		break;
>>  	case -EAGAIN:
>>  		status = xs_nospace(task);
>>  		break;
> 
> The only case where xs_sendpages() will return ENOTSOCK is if
> transport->sock == NULL, so the correct fix here is to just remove 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

> 
> Cheers
>   Trond

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux