]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rds_rdma: rds_sendmsg should return EAGAIN if connection not setup
authorWengang Wang <wen.gang.wang@oracle.com>
Tue, 4 Aug 2015 08:00:55 +0000 (16:00 +0800)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 12 Aug 2015 22:44:34 +0000 (15:44 -0700)
commit3d6e0fed8edc2f5d5439bee22c2fa153096c77ea
tree5f95077b307352a0abb65d9776f4ea9d3bc7bb5d
parent5660542fb74b493cb469ec8c27fb6927e01f2934
rds_rdma: rds_sendmsg should return EAGAIN if connection not setup

In rds_sendmsg(), in the case RDS_CMSG_RDMA_MAP is requested and
rds_cmsg_send() is called, a "struct rds_mr" needs to be created.
For creating the "struct rds_mr", the connection needs to be
established(ready) for rds_ib_transport. Otherwise, __rds_rdma_map()
would fail because it can't find the right rds_ib_device (which is
associated with the ip address matching rds_sock's bound ip address).
The ip address is set at the completion of the rdma connection.

But actually in code, the connecting is triggered after the call of call
rds_cmsg_send() so rds_cmsg_send() would fail with -NODEV.

The fix is to move the trigger of connection before calling
rds_cmsg_send() and return -EAGAIN in case connection is not
ready yet when we are calling rds_cmsg_send().

Orabug: 21551474

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: Chien-Hua Yen <chien.yen@oracle.com>
net/rds/send.c