Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49f69691 authored by Andy Grover's avatar Andy Grover Committed by David S. Miller
Browse files

RDS: Establish connection before parsing CMSGs



The first message to a remote node should prompt a new connection.
Even an RDMA op via CMSG. Therefore move CMSG parsing to after
connection establishment.

Signed-off-by: default avatarAndy Grover <andy.grover@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7acd4a79
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -854,11 +854,6 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,


	rm->m_daddr = daddr;
	rm->m_daddr = daddr;


	/* Parse any control messages the user may have included. */
	ret = rds_cmsg_send(rs, rm, msg, &allocated_mr);
	if (ret)
		goto out;

	/* rds_conn_create has a spinlock that runs with IRQ off.
	/* rds_conn_create has a spinlock that runs with IRQ off.
	 * Caching the conn in the socket helps a lot. */
	 * Caching the conn in the socket helps a lot. */
	if (rs->rs_conn && rs->rs_conn->c_faddr == daddr)
	if (rs->rs_conn && rs->rs_conn->c_faddr == daddr)
@@ -874,6 +869,11 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
		rs->rs_conn = conn;
		rs->rs_conn = conn;
	}
	}


	/* Parse any control messages the user may have included. */
	ret = rds_cmsg_send(rs, rm, msg, &allocated_mr);
	if (ret)
		goto out;

	if ((rm->m_rdma_cookie || rm->m_rdma_op)
	if ((rm->m_rdma_cookie || rm->m_rdma_op)
	 && conn->c_trans->xmit_rdma == NULL) {
	 && conn->c_trans->xmit_rdma == NULL) {
		if (printk_ratelimit())
		if (printk_ratelimit())