Commit 9f9d2ebe authored by J. Bruce Fields's avatar J. Bruce Fields

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: default avatarJ. Bruce Fields <bfields@redhat.com>
parent af6d5721
...@@ -743,7 +743,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) ...@@ -743,7 +743,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
svc_xprt_received(xprt); svc_xprt_received(xprt);
/* No data, incomplete (TCP) read, or accept() */ /* No data, incomplete (TCP) read, or accept() */
if (len == 0 || len == -EAGAIN) if (len <= 0)
goto out; goto out;
clear_bit(XPT_OLD, &xprt->xpt_flags); clear_bit(XPT_OLD, &xprt->xpt_flags);
......
...@@ -598,7 +598,7 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp) ...@@ -598,7 +598,7 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
dprintk("svc: recvfrom returned error %d\n", -err); dprintk("svc: recvfrom returned error %d\n", -err);
set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
} }
return -EAGAIN; return 0;
} }
len = svc_addr_len(svc_addr(rqstp)); len = svc_addr_len(svc_addr(rqstp));
rqstp->rq_addrlen = len; rqstp->rq_addrlen = len;
...@@ -1174,13 +1174,13 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) ...@@ -1174,13 +1174,13 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
if (len != -EAGAIN) if (len != -EAGAIN)
goto err_other; goto err_other;
dprintk("RPC: TCP recvfrom got EAGAIN\n"); dprintk("RPC: TCP recvfrom got EAGAIN\n");
return -EAGAIN; return 0;
err_other: err_other:
printk(KERN_NOTICE "%s: recvfrom returned errno %d\n", printk(KERN_NOTICE "%s: recvfrom returned errno %d\n",
svsk->sk_xprt.xpt_server->sv_name, -len); svsk->sk_xprt.xpt_server->sv_name, -len);
set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags);
err_noclose: err_noclose:
return -EAGAIN; /* record not complete */ return 0; /* record not complete */
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment