From patchwork Fri Feb 23 22:09:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10239919 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2D8486056E for ; Fri, 23 Feb 2018 22:09:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 165AC29A1E for ; Fri, 23 Feb 2018 22:09:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0ABB529A25; Fri, 23 Feb 2018 22:09:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A761A29A24 for ; Fri, 23 Feb 2018 22:09:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751733AbeBWWJ2 (ORCPT ); Fri, 23 Feb 2018 17:09:28 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:45313 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751578AbeBWWJ1 (ORCPT ); Fri, 23 Feb 2018 17:09:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1519423768; x=1550959768; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=odK2Jg8cICa9Ob+LeDmp2e+IuGNBRFGdHZoFOiHMzBA=; b=RG1medcxLVVLk/6mu+ygH+0iYpCrqiroXL9+EpAVawi1VusQDAFtjYXV /y6L+KqP8TlfU2zj7eegOB6DIr2vFzbm6qTGgla5PDbDFv0Xt7+cvH5ue n3CJsffqxrLTIvNwXCFlWUHc+4R5qZr/AV2GoMr4iWc0c0xzF9sqQ8q5N DV75ZsGAzhyHsur3rKpxRKpspmg/wOQaPTxD26QUVDMra4q4FpnH0ubNH Nwuh2oWHzkV9RoEBlj//qGD+K4rSEayc6Ajd+lixHBiYl/B6y7Gj97fWN BhUBxj9KjEMaKF4mmtM20fLPQ/3Q6jMvxPhKuDnraEHE6BFV9yMm0h0w6 w==; X-IronPort-AV: E=Sophos;i="5.47,383,1515427200"; d="scan'208";a="72667331" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 24 Feb 2018 06:09:27 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 23 Feb 2018 14:03:02 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.46.240]) by uls-op-cesaip01.wdc.com with ESMTP; 23 Feb 2018 14:09:26 -0800 From: Bart Van Assche To: Jason Gunthorpe Cc: Doug Ledford , Laurence Oberman , linux-rdma@vger.kernel.org, Bart Van Assche , stable@vger.kernel.org Subject: [PATCH 1/3] IB/srp: Fix srp_abort() Date: Fri, 23 Feb 2018 14:09:24 -0800 Message-Id: <20180223220926.707-2-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223220926.707-1-bart.vanassche@wdc.com> References: <20180223220926.707-1-bart.vanassche@wdc.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/infiniband/ulp/srp/ib_srp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 241c0e72dce3..4a1a489ce8bb 100644 --- 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 *scmnd) 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; }