Commit 9f9d2ebe693a98d517257e1a39f61120b4473b96

Authored by J. Bruce Fields
1 parent af6d572134

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>

Showing 2 changed files with 4 additions and 4 deletions Side-by-side Diff

net/sunrpc/svc_xprt.c
... ... @@ -743,7 +743,7 @@
743 743 svc_xprt_received(xprt);
744 744  
745 745 /* No data, incomplete (TCP) read, or accept() */
746   - if (len == 0 || len == -EAGAIN)
  746 + if (len <= 0)
747 747 goto out;
748 748  
749 749 clear_bit(XPT_OLD, &xprt->xpt_flags);
net/sunrpc/svcsock.c
... ... @@ -598,7 +598,7 @@
598 598 dprintk("svc: recvfrom returned error %d\n", -err);
599 599 set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
600 600 }
601   - return -EAGAIN;
  601 + return 0;
602 602 }
603 603 len = svc_addr_len(svc_addr(rqstp));
604 604 rqstp->rq_addrlen = len;
605 605  
... ... @@ -1174,13 +1174,13 @@
1174 1174 if (len != -EAGAIN)
1175 1175 goto err_other;
1176 1176 dprintk("RPC: TCP recvfrom got EAGAIN\n");
1177   - return -EAGAIN;
  1177 + return 0;
1178 1178 err_other:
1179 1179 printk(KERN_NOTICE "%s: recvfrom returned errno %d\n",
1180 1180 svsk->sk_xprt.xpt_server->sv_name, -len);
1181 1181 set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags);
1182 1182 err_noclose:
1183   - return -EAGAIN; /* record not complete */
  1183 + return 0; /* record not complete */
1184 1184 }
1185 1185  
1186 1186 /*