]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
rds: RDS (tcp) hangs on sendto() to unresponding address
authorKa-Cheong Poon <ka-cheong.poon@oracle.com>
Tue, 2 Oct 2018 14:50:02 +0000 (07:50 -0700)
committerBrian Maly <brian.maly@oracle.com>
Thu, 18 Oct 2018 19:50:47 +0000 (15:50 -0400)
In rds_send_mprds_hash(), if the calculated hash value is non-zero and
the MPRDS connections are not yet up, it will wait.  But it should not
wait if the send is non-blocking.  In this case, it should just use the
base c_path for sending the message.

Orabug: 28762608

Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
Reviewed-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
net/rds/send.c

index 6a753aeafe913bda63df4918e4d87507aba5b3ea..c1ca5a12e512fd13f069201f667d7902bfbc86d2 100644 (file)
@@ -1182,7 +1182,8 @@ static inline int rds_rdma_bytes(struct msghdr *msg, size_t *rdma_bytes)
        return 0;
 }
 
-static int rds_send_mprds_hash(struct rds_sock *rs, struct rds_connection *conn)
+static int rds_send_mprds_hash(struct rds_sock *rs,
+                              struct rds_connection *conn, int nonblock)
 {
        int hash;
 
@@ -1194,6 +1195,11 @@ static int rds_send_mprds_hash(struct rds_sock *rs, struct rds_connection *conn)
                rds_send_ping(conn, 0);
 
                if (conn->c_npaths == 0) {
+                       /* Cannot wait for the connection be made, so just use
+                        * the base c_path.
+                        */
+                       if (nonblock)
+                               return 0;
                        wait_event_interruptible(conn->c_hs_waitq,
                                                 (conn->c_npaths != 0));
                }
@@ -1386,7 +1392,7 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
        }
 
        if (conn->c_trans->t_mp_capable)
-               cpath = &conn->c_path[rds_send_mprds_hash(rs, conn)];
+               cpath = &conn->c_path[rds_send_mprds_hash(rs, conn, nonblock)];
        else
                cpath = &conn->c_path[0];