From: Ka-Cheong Poon Date: Tue, 2 Oct 2018 14:50:02 +0000 (-0700) Subject: rds: RDS (tcp) hangs on sendto() to unresponding address X-Git-Tag: v4.1.12-124.31.3~488 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4d8376fac652927fcc94ca88db134ce7822c03c1;p=users%2Fjedix%2Flinux-maple.git rds: RDS (tcp) hangs on sendto() to unresponding address 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 Reviewed-by: Sowmini Varadhan Reviewed-by: Santosh Shilimkar Signed-off-by: Brian Maly --- diff --git a/net/rds/send.c b/net/rds/send.c index 6a753aeafe913..c1ca5a12e512f 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -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];