Skip to content

Commit

Permalink
RDS: Establish connection before parsing CMSGs
Browse files Browse the repository at this point in the history
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: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andy Grover authored and David S. Miller committed Apr 10, 2009
1 parent 7acd4a7 commit 49f6969
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions net/rds/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,11 +854,6 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,

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.
* Caching the conn in the socket helps a lot. */
if (rs->rs_conn && rs->rs_conn->c_faddr == daddr)
Expand All @@ -874,6 +869,11 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
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)
&& conn->c_trans->xmit_rdma == NULL) {
if (printk_ratelimit())
Expand Down

0 comments on commit 49f6969

Please sign in to comment.