Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2199700f1d660494d2552278354422c51becb686
Commit:     2199700f1d660494d2552278354422c51becb686
Parent:     58eaab93376cb524fd0f1531a56902d2b3eaa619
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 1 11:43:37 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 17:20:37 2007 -0400

    SUNRPC: Fix buggy UDP transmission
    
    xs_sendpages() may return a negative result. We sure as hell don't want to
    add that to the 'tk_bytes_sent' tally...
    
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 net/sunrpc/xprtsock.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index e97e4ca..6f32cc5 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -587,13 +587,13 @@ static int xs_udp_send_request(struct rpc_task *task)
        dprintk("RPC:       xs_udp_send_request(%u) = %d\n",
                        xdr->len - req->rq_bytes_sent, status);
 
-       task->tk_bytes_sent += status;
-       if (likely(status >= (int) req->rq_slen))
-               return 0;
-
-       /* Still some bytes left; set up for a retry later. */
-       if (status > 0)
+       if (status >= 0) {
+               task->tk_bytes_sent += status;
+               if (status >= req->rq_slen)
+                       return 0;
+               /* Still some bytes left; set up for a retry later. */
                status = -EAGAIN;
+       }
 
        switch (status) {
        case -ENETUNREACH:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to