diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2015-05-18 07:23:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-21 13:10:05 -0400 |
commit | 86e4f5b10e79205f5eb254a3c60d111931f2a274 (patch) | |
tree | 64c4458c43298e99bceb1af0323c2157d7124bfa | |
parent | 5e72c7cc287d9415debd623e96ac275f20d37645 (diff) |
IB/srp: Fix a connection setup race
commit 8de9fe3a1d4ac8c3e4953fa4b7d81f863f5196ad upstream.
Avoid that receiving a DREQ while RDMA channels are being
established causes target->qp_in_error to be reset.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 5ce6cfd86476..f2daabd1e91d 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -993,8 +993,6 @@ static int srp_connect_ch(struct srp_rdma_ch *ch, bool multich) | |||
993 | 993 | ||
994 | WARN_ON_ONCE(!multich && target->connected); | 994 | WARN_ON_ONCE(!multich && target->connected); |
995 | 995 | ||
996 | target->qp_in_error = false; | ||
997 | |||
998 | ret = srp_lookup_path(ch); | 996 | ret = srp_lookup_path(ch); |
999 | if (ret) | 997 | if (ret) |
1000 | return ret; | 998 | return ret; |
@@ -1243,6 +1241,9 @@ static int srp_rport_reconnect(struct srp_rport *rport) | |||
1243 | for (j = 0; j < target->queue_size; ++j) | 1241 | for (j = 0; j < target->queue_size; ++j) |
1244 | list_add(&ch->tx_ring[j]->list, &ch->free_tx); | 1242 | list_add(&ch->tx_ring[j]->list, &ch->free_tx); |
1245 | } | 1243 | } |
1244 | |||
1245 | target->qp_in_error = false; | ||
1246 | |||
1246 | for (i = 0; i < target->ch_count; i++) { | 1247 | for (i = 0; i < target->ch_count; i++) { |
1247 | ch = &target->ch[i]; | 1248 | ch = &target->ch[i]; |
1248 | if (ret || !ch->target) { | 1249 | if (ret || !ch->target) { |