From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:38445 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932340AbbGSTIu (ORCPT ); Sun, 19 Jul 2015 15:08:50 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bart Van Assche , Sagi Grimberg , Sebastian Parschauer , Doug Ledford Subject: [PATCH 4.1 55/65] IB/srp: Fix reconnection failure handling Date: Sun, 19 Jul 2015 12:08:14 -0700 Message-Id: <20150719190811.280625234@linuxfoundation.org> In-Reply-To: <20150719190809.469715936@linuxfoundation.org> References: <20150719190809.469715936@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: stable-owner@vger.kernel.org List-ID: 4.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bart Van Assche 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 Cc: Sagi Grimberg Cc: Sebastian Parschauer Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- 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; }