Skip to content

Commit

Permalink
net/rds: Initialize ic->i_fastreg_wrs upon allocation
Browse files Browse the repository at this point in the history
Otherwise, if an IB connection is torn down before "rds_ib_setup_qp"
is called, the value of "ic->i_fastreg_wrs" is still at zero
(as it wasn't initialized by "rds_ib_setup_qp").
Consequently "rds_ib_conn_path_shutdown" will spin forever,
waiting for it to go back to "RDS_IB_DEFAULT_FR_WR",
which of course will never happen as there are no
outstanding work requests.

Signed-off-by: Gerd Rausch <[email protected]>
Acked-by: Santosh Shilimkar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
gerd-rausch authored and davem330 committed Jul 17, 2019
1 parent 3a2886c commit aa49489
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/rds/ib_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
attr.qp_type = IB_QPT_RC;
attr.send_cq = ic->i_send_cq;
attr.recv_cq = ic->i_recv_cq;
atomic_set(&ic->i_fastreg_wrs, RDS_IB_DEFAULT_FR_WR);

/*
* XXX this can fail if max_*_wr is too large? Are we supposed
Expand Down Expand Up @@ -1139,6 +1138,7 @@ int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp)
spin_lock_init(&ic->i_ack_lock);
#endif
atomic_set(&ic->i_signaled_sends, 0);
atomic_set(&ic->i_fastreg_wrs, RDS_IB_DEFAULT_FR_WR);

/*
* rds_ib_conn_shutdown() waits for these to be emptied so they
Expand Down

0 comments on commit aa49489

Please sign in to comment.