summaryrefslogtreecommitdiff
path: root/net/rds
diff options
context:
space:
mode:
authorAndy Grover <andy.grover@oracle.com>2009-04-09 14:09:41 +0000
committerDavid S. Miller <davem@davemloft.net>2009-04-09 17:21:19 -0700
commit49f696914100780f6bf8e652d3468de0015d6172 (patch)
tree7db75b8f01ed4cec915196c5c00923cda580e385 /net/rds
parent7acd4a794c1530af063e51f3f7171e75556458f3 (diff)
downloadlinux-3.10-49f696914100780f6bf8e652d3468de0015d6172.tar.gz
linux-3.10-49f696914100780f6bf8e652d3468de0015d6172.tar.bz2
linux-3.10-49f696914100780f6bf8e652d3468de0015d6172.zip
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: Andy Grover <andy.grover@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds')
-rw-r--r--net/rds/send.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/rds/send.c b/net/rds/send.c
index 104fe033203..a4a7f428cd7 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -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)
@@ -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())