| From a44074f14ba1ea0747ea737026eb929b81993dc3 Mon Sep 17 00:00:00 2001 |
| From: Bart Van Assche <bart.vanassche@sandisk.com> |
| Date: Mon, 18 May 2015 13:24:17 +0200 |
| Subject: IB/srp: Fix reconnection failure handling |
| |
| From: Bart Van Assche <bart.vanassche@sandisk.com> |
| |
| commit a44074f14ba1ea0747ea737026eb929b81993dc3 upstream. |
| |
| Although it is possible to let SRP I/O continue if a reconnect |
| results in a reduction of the number of channels, the current |
| code does not handle this scenario correctly. Instead of making |
| the reconnect code more complex, consider this as a reconnection |
| failure. |
| |
| 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> |
| |
| --- |
| drivers/infiniband/ulp/srp/ib_srp.c | 5 +---- |
| 1 file changed, 1 insertion(+), 4 deletions(-) |
| |
| --- a/drivers/infiniband/ulp/srp/ib_srp.c |
| +++ b/drivers/infiniband/ulp/srp/ib_srp.c |
| @@ -1243,11 +1243,8 @@ static int srp_rport_reconnect(struct sr |
| |
| for (i = 0; i < target->ch_count; i++) { |
| ch = &target->ch[i]; |
| - if (ret || !ch->target) { |
| - if (i > 1) |
| - ret = 0; |
| + if (ret || !ch->target) |
| break; |
| - } |
| ret = srp_connect_ch(ch, multich); |
| multich = true; |
| } |