summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@sandisk.com>2015-05-18 14:23:36 +0300
committerDoug Ledford <dledford@redhat.com>2015-05-18 20:35:55 +0300
commit8de9fe3a1d4ac8c3e4953fa4b7d81f863f5196ad (patch)
tree15eca90fb74b49c20989eafec1e6f8f4b2311f59
parentfb49c8bbaae70b14fea2b4590a90a21539f88526 (diff)
downloadlinux-8de9fe3a1d4ac8c3e4953fa4b7d81f863f5196ad.tar.xz
IB/srp: Fix a connection setup race
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> Cc: <stable@vger.kernel.org> #v3.19 Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c5
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)
WARN_ON_ONCE(!multich && target->connected);
- target->qp_in_error = false;
-
ret = srp_lookup_path(ch);
if (ret)
return ret;
@@ -1243,6 +1241,9 @@ static int srp_rport_reconnect(struct srp_rport *rport)
for (j = 0; j < target->queue_size; ++j)
list_add(&ch->tx_ring[j]->list, &ch->free_tx);
}
+
+ target->qp_in_error = false;
+
for (i = 0; i < target->ch_count; i++) {
ch = &target->ch[i];
if (ret || !ch->target) {