Received: by 10.192.165.148 with SMTP id m20csp2529433imm; Sun, 22 Apr 2018 08:57:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx48RtTWyy/2dd+LweLVu5WovZ4ep76Pt9J/MHgWUfSlq8OdwyPYvvHIu52gkxUkx2nbu+a1L X-Received: by 10.98.166.206 with SMTP id r75mr17049312pfl.82.1524412652998; Sun, 22 Apr 2018 08:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524412652; cv=none; d=google.com; s=arc-20160816; b=RCzVB7IpC1EtrLGFdBjSa+oCYQ/TGCT/zL/krLR0rT8uZWpTUvvQiSTQ+kv5UXVYS4 wcd4bwmriNfWoq9dV3JgOsZd8CjcYMXqR5H5JWgLdOrp2o4KB2C6MtkLi2aMgt61LAQd Z+faHvh1ttdc9pjFFvzbqa4Qfo6fo5RwHUsyteYlfpoPXSSnc5JFeNZF1rhBaoSuDzj2 twIyJ8hwzntNhisiWHRmGzW1AIXdKXNztZ2/j6j018LHtstFOMtWLnET2xjGBkxu9diU 9i5rtOV/rrxaLk/1pqv0LrLk1+eKNAnFENOu1XVLz1fkTVvB3Xo5M27Nkuox7Prd7n5G Rpxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=nfw1fMbLDOeST5dys4jC/1PCmHx2L5/p/4Li9GjCxIE=; b=vqtYbqXOdrFQsIJGayh0T9Msub9JSRjffdWDZWa5zenKj7ymzrxPnADHE4hCJwuLDS qalNuHuhp5Qw2kCUDYSZ76wza8Am1mEXMyatHOwHPztG8vIruA4qmarBf/XQ6ObT/8WT UlSWLyfYeo9FaftPjA1RsyLSZNKGEZuqz8Uvy/7kat+aAEGf9BirOdnBg8MQmOX7MCti 5NF+ZhErshmHNrZsCAH2mmV/YbrWYFT1S1mnnFke7lLH27emKn5DPczF4gDW2H/7FVfV fL61LFuG5qtP0Kswqw9d8sKu2kL3RksP4gzc/uYwsEK1hKOtMw7IdkPLIn4RdUBfxiKr T6OQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si8369824pgn.210.2018.04.22.08.57.18; Sun, 22 Apr 2018 08:57:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754380AbeDVN7h (ORCPT + 99 others); Sun, 22 Apr 2018 09:59:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46870 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754011AbeDVN71 (ORCPT ); Sun, 22 Apr 2018 09:59:27 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 65E5092F; Sun, 22 Apr 2018 13:59:26 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bart Van Assche , Jason Gunthorpe Subject: [PATCH 4.16 113/196] IB/srp: Fix srp_abort() Date: Sun, 22 Apr 2018 15:52:13 +0200 Message-Id: <20180422135110.111237232@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bart Van Assche commit e68088e78d82920632eba112b968e49d588d02a2 upstream. Before commit e494f6a72839 ("[SCSI] improved eh timeout handler") it did not really matter whether or not abort handlers like srp_abort() called .scsi_done() when returning another value than SUCCESS. Since that commit however this matters. Hence only call .scsi_done() when returning SUCCESS. Signed-off-by: Bart Van Assche Cc: stable@vger.kernel.org Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/ulp/srp/ib_srp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -2974,9 +2974,11 @@ static int srp_abort(struct scsi_cmnd *s ret = FAST_IO_FAIL; else ret = FAILED; - srp_free_req(ch, req, scmnd, 0); - scmnd->result = DID_ABORT << 16; - scmnd->scsi_done(scmnd); + if (ret == SUCCESS) { + srp_free_req(ch, req, scmnd, 0); + scmnd->result = DID_ABORT << 16; + scmnd->scsi_done(scmnd); + } return ret; }