diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-08-17 21:35:24 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-08-21 17:41:07 -0400 |
commit | 9f9d2ebe693a98d517257e1a39f61120b4473b96 (patch) | |
tree | e90209c5bee26637b48e9d4c1f382b780a5921ad /net/sunrpc | |
parent | af6d572134b012ca92c4efc8a2f1cadbe5d01064 (diff) |
svcrpc: make xpo_recvfrom return only >=0
The only errors returned from xpo_recvfrom have been -EAGAIN and
-EAFNOSUPPORT. The latter was removed by a previous patch. That leaves
only -EAGAIN, which is treated just like 0 by the caller (svc_recv).
So, just ditch -EAGAIN and return 0 instead.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 2 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index ee15663798b3..3e317307e288 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -743,7 +743,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) | |||
743 | svc_xprt_received(xprt); | 743 | svc_xprt_received(xprt); |
744 | 744 | ||
745 | /* No data, incomplete (TCP) read, or accept() */ | 745 | /* No data, incomplete (TCP) read, or accept() */ |
746 | if (len == 0 || len == -EAGAIN) | 746 | if (len <= 0) |
747 | goto out; | 747 | goto out; |
748 | 748 | ||
749 | clear_bit(XPT_OLD, &xprt->xpt_flags); | 749 | clear_bit(XPT_OLD, &xprt->xpt_flags); |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 406688baac57..7aee54c3fe46 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -598,7 +598,7 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp) | |||
598 | dprintk("svc: recvfrom returned error %d\n", -err); | 598 | dprintk("svc: recvfrom returned error %d\n", -err); |
599 | set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); | 599 | set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); |
600 | } | 600 | } |
601 | return -EAGAIN; | 601 | return 0; |
602 | } | 602 | } |
603 | len = svc_addr_len(svc_addr(rqstp)); | 603 | len = svc_addr_len(svc_addr(rqstp)); |
604 | rqstp->rq_addrlen = len; | 604 | rqstp->rq_addrlen = len; |
@@ -1174,13 +1174,13 @@ error: | |||
1174 | if (len != -EAGAIN) | 1174 | if (len != -EAGAIN) |
1175 | goto err_other; | 1175 | goto err_other; |
1176 | dprintk("RPC: TCP recvfrom got EAGAIN\n"); | 1176 | dprintk("RPC: TCP recvfrom got EAGAIN\n"); |
1177 | return -EAGAIN; | 1177 | return 0; |
1178 | err_other: | 1178 | err_other: |
1179 | printk(KERN_NOTICE "%s: recvfrom returned errno %d\n", | 1179 | printk(KERN_NOTICE "%s: recvfrom returned errno %d\n", |
1180 | svsk->sk_xprt.xpt_server->sv_name, -len); | 1180 | svsk->sk_xprt.xpt_server->sv_name, -len); |
1181 | set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); | 1181 | set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); |
1182 | err_noclose: | 1182 | err_noclose: |
1183 | return -EAGAIN; /* record not complete */ | 1183 | return 0; /* record not complete */ |
1184 | } | 1184 | } |
1185 | 1185 | ||
1186 | /* | 1186 | /* |