SUNRPC: Report TCP errors to the caller
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 11 Jul 2015 15:48:52 +0000 (17:48 +0200)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 27 Jul 2015 21:56:57 +0000 (17:56 -0400)
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
net/sunrpc/xprtsock.c

index 4f48b1a19e9f39399006716728c90bdee1ded21a..6a21368bdd8eb72313430ff192e582781f35023c 100644 (file)
@@ -677,9 +677,6 @@ static int xs_tcp_send_request(struct rpc_task *task)
                dprintk("RPC:       xs_tcp_send_request(%u) = %d\n",
                                xdr->len - req->rq_bytes_sent, status);
 
-               if (unlikely(sent == 0 && status < 0))
-                       break;
-
                /* If we've sent the entire packet, immediately
                 * reset the count of bytes sent. */
                req->rq_bytes_sent += sent;
@@ -689,10 +686,12 @@ static int xs_tcp_send_request(struct rpc_task *task)
                        return 0;
                }
 
-               if (sent != 0)
-                       continue;
-               status = -EAGAIN;
-               break;
+               if (status < 0)
+                       break;
+               if (sent == 0) {
+                       status = -EAGAIN;
+                       break;
+               }
        }
        if (status == -EAGAIN && sk_stream_is_writeable(transport->inet))
                status = -ENOBUFS;