diff options
author | Bian Naimeng <biannm@cn.fujitsu.com> | 2010-03-08 01:49:01 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-08 14:05:57 -0500 |
commit | 5fe46e9d733f19a880ef7e516002bd4c2b833e14 (patch) | |
tree | e63ececb8fa5100b3f2514b0d2e9702086ccd101 /net | |
parent | 25cf84cf377c0aae5dbcf937ea89bc7893db5176 (diff) |
rpc client can not deal with ENOSOCK, so translate it into ENOCONN
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 make sure ->send_request can
translate ENOSOCK into ENOCONN.
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xprtsock.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 712412982cee..abb8a589555f 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -549,8 +549,6 @@ static int xs_udp_send_request(struct rpc_task *task) | |||
549 | /* Still some bytes left; set up for a retry later. */ | 549 | /* Still some bytes left; set up for a retry later. */ |
550 | status = -EAGAIN; | 550 | status = -EAGAIN; |
551 | } | 551 | } |
552 | if (!transport->sock) | ||
553 | goto out; | ||
554 | 552 | ||
555 | switch (status) { | 553 | switch (status) { |
556 | case -ENOTSOCK: | 554 | case -ENOTSOCK: |
@@ -570,7 +568,7 @@ static int xs_udp_send_request(struct rpc_task *task) | |||
570 | * prompts ECONNREFUSED. */ | 568 | * prompts ECONNREFUSED. */ |
571 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); | 569 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); |
572 | } | 570 | } |
573 | out: | 571 | |
574 | return status; | 572 | return status; |
575 | } | 573 | } |
576 | 574 | ||
@@ -652,8 +650,6 @@ static int xs_tcp_send_request(struct rpc_task *task) | |||
652 | status = -EAGAIN; | 650 | status = -EAGAIN; |
653 | break; | 651 | break; |
654 | } | 652 | } |
655 | if (!transport->sock) | ||
656 | goto out; | ||
657 | 653 | ||
658 | switch (status) { | 654 | switch (status) { |
659 | case -ENOTSOCK: | 655 | case -ENOTSOCK: |
@@ -673,7 +669,7 @@ static int xs_tcp_send_request(struct rpc_task *task) | |||
673 | case -ENOTCONN: | 669 | case -ENOTCONN: |
674 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); | 670 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); |
675 | } | 671 | } |
676 | out: | 672 | |
677 | return status; | 673 | return status; |
678 | } | 674 | } |
679 | 675 | ||