aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorBian Naimeng <biannm@cn.fujitsu.com>2010-03-08 14:49:01 +0800
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-03-08 14:05:57 -0500
commit5fe46e9d733f19a880ef7e516002bd4c2b833e14 (patch)
treee63ececb8fa5100b3f2514b0d2e9702086ccd101 /net/sunrpc
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/amit/virtio-console (diff)
downloadlinux-dev-5fe46e9d733f19a880ef7e516002bd4c2b833e14.tar.xz
linux-dev-5fe46e9d733f19a880ef7e516002bd4c2b833e14.zip
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/sunrpc')
-rw-r--r--net/sunrpc/xprtsock.c8
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)
/* Still some bytes left; set up for a retry later. */
status = -EAGAIN;
}
- if (!transport->sock)
- goto out;
switch (status) {
case -ENOTSOCK:
@@ -570,7 +568,7 @@ static int xs_udp_send_request(struct rpc_task *task)
* prompts ECONNREFUSED. */
clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags);
}
-out:
+
return status;
}
@@ -652,8 +650,6 @@ static int xs_tcp_send_request(struct rpc_task *task)
status = -EAGAIN;
break;
}
- if (!transport->sock)
- goto out;
switch (status) {
case -ENOTSOCK:
@@ -673,7 +669,7 @@ static int xs_tcp_send_request(struct rpc_task *task)
case -ENOTCONN:
clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags);
}
-out:
+
return status;
}