diff mbox

[1/4] SUNRPC: Ensure xprt_connect_status handles all potential connection errors

Message ID 1388518781-33571-1-git-send-email-trond.myklebust@primarydata.com (mailing list archive)
State New, archived
Headers show

Commit Message

Trond Myklebust Dec. 31, 2013, 7:39 p.m. UTC
Currently, xprt_connect_status will convert connection error values such
as ECONNREFUSED, ECONNRESET, ... into EIO, which means that they never
get handled.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 net/sunrpc/xprt.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Kinglong Mee Jan. 2, 2014, 4:52 a.m. UTC | #1
Hi Trond, 

With the whole patchset, rpc.nfsd will return immediately as,
[root@localhost linux-2.6]# rpc.nfsd -N 2 -N 3
rpc.nfsd: writing fd to kernel failed: errno 13 (Permission denied)
rpc.nfsd: writing fd to kernel failed: errno 13 (Permission denied)
rpc.nfsd: unable to set any sockets for nfsd
[root@localhost linux-2.6]# dmesg
[ 1263.249079] svc: failed to register nfsdv4 RPC service (errno 13).
[ 1263.257789] svc: failed to register nfsdv4 RPC service (errno 13).

But, I think errno 13 cannot give user the correct meaning.
As before, errno 111 (Connection refused) maybe better.

thanks,
Kinglong Mee

On 01/01/2014 03:39 AM, Trond Myklebust wrote:
> Currently, xprt_connect_status will convert connection error values such
> as ECONNREFUSED, ECONNRESET, ... into EIO, which means that they never
> get handled.
> 
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> ---
>  net/sunrpc/xprt.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
> index 04199bc8416f..ddd198e90292 100644
> --- a/net/sunrpc/xprt.c
> +++ b/net/sunrpc/xprt.c
> @@ -749,6 +749,11 @@ static void xprt_connect_status(struct rpc_task *task)
>  	}
>  
>  	switch (task->tk_status) {
> +	case -ECONNREFUSED:
> +	case -ECONNRESET:
> +	case -ECONNABORTED:
> +	case -ENETUNREACH:
> +	case -EHOSTUNREACH:
>  	case -EAGAIN:
>  		dprintk("RPC: %5u xprt_connect_status: retrying\n", task->tk_pid);
>  		break;
> 

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

Patch

diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 04199bc8416f..ddd198e90292 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -749,6 +749,11 @@  static void xprt_connect_status(struct rpc_task *task)
 	}
 
 	switch (task->tk_status) {
+	case -ECONNREFUSED:
+	case -ECONNRESET:
+	case -ECONNABORTED:
+	case -ENETUNREACH:
+	case -EHOSTUNREACH:
 	case -EAGAIN:
 		dprintk("RPC: %5u xprt_connect_status: retrying\n", task->tk_pid);
 		break;