Skip to content

Commit c055fc0

Browse files
ea1davisdavem330
authored andcommitted
net/rds: fix WARNING in rds_conn_connect_if_down
If connection isn't established yet, get_mr() will fail, trigger connection after get_mr(). Fixes: 584a827 ("RDS: RDMA: return appropriate error on rdma map failures") Reported-and-tested-by: [email protected] Signed-off-by: Edward Adam Davis <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f287d6a commit c055fc0

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

net/rds/rdma.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ static int __rds_rdma_map(struct rds_sock *rs, struct rds_get_mr_args *args,
301301
kfree(sg);
302302
}
303303
ret = PTR_ERR(trans_private);
304+
/* Trigger connection so that its ready for the next retry */
305+
if (ret == -ENODEV)
306+
rds_conn_connect_if_down(cp->cp_conn);
304307
goto out;
305308
}
306309

net/rds/send.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,12 +1313,8 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
13131313

13141314
/* Parse any control messages the user may have included. */
13151315
ret = rds_cmsg_send(rs, rm, msg, &allocated_mr, &vct);
1316-
if (ret) {
1317-
/* Trigger connection so that its ready for the next retry */
1318-
if (ret == -EAGAIN)
1319-
rds_conn_connect_if_down(conn);
1316+
if (ret)
13201317
goto out;
1321-
}
13221318

13231319
if (rm->rdma.op_active && !conn->c_trans->xmit_rdma) {
13241320
printk_ratelimited(KERN_NOTICE "rdma_op %p conn xmit_rdma %p\n",

0 commit comments

Comments
 (0)