Received: by 10.192.165.148 with SMTP id m20csp2450738imm; Sun, 22 Apr 2018 07:18:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx489n/lTKXUBxCz3UeubLnMtFU+8EHeF+DZJBhnhy69OuiGdYz46ngjxxYk0vHKuLPjcC1p1 X-Received: by 10.98.223.205 with SMTP id d74mr16818207pfl.114.1524406736686; Sun, 22 Apr 2018 07:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524406736; cv=none; d=google.com; s=arc-20160816; b=ysg8ztvp1eGferEtkF8Rl4hFjTaKn1rC9PiK5qzJkGeoalCsnKNbAtUEvXjUsYyllf f7q7zhZ6/snmfIlQaDgGv/5aQFgv2WLSgH9elAjrK8avyasc/7jSo7u7uBzDlZFE2Wj1 h2pNPqAV6fZUMFzufuXYLabeEgrWlAomKoYmQ6fPVqvsxTKw04CmqqgiziKXEZ81WdM3 87/BXgcdJIE+qPmWJ6lnfytEj+zDTCEmieNyM78EwhQMh1q/bEIQyww5gOkzoj6pVOPs XbD3px6NB6uVL8IrU5eK8N2l9E2Yd/dgUK1/1eKohLlPkDwaAWzNKCYKAMcuqYPvqlFQ 6Rfg== 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=fsoV7jrnLZk4oag43FQdZK9PBueLu07b2zcOv6Pnt2M=; b=dwsMjTqWnqkp+3nVVi/GHB9egFUxByePSHUO0ZvHCA90+VLG37EhSyCQcTlJFHeJ83 3xYZyXtmpiEua/5pumy1cMke84mLakfQYAiOiYM5/NmHCAfrUSmMMaHwsaDIPNU15JaJ enWXXGhtQItxlT7fI7GewfXezHNSR/h3XWzWzqqASrMN03mABsQ6fh1D34GWJIF7jJ14 difPWMijOT5tEvbmbzFUfVUhQIilB22Jz61DBUx6cTeBV2ges2VXL0qdLtQeVZwOa85H MwK6qoxQhUEStJYaNhcd53qjZnnZ8lk8QRb7oprgPgmx+D7Pw9zgAMhHbnXw03jJZQlX mMvw== 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 u9si9550917pfa.293.2018.04.22.07.18.42; Sun, 22 Apr 2018 07:18:56 -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 S1756956AbeDVORk (ORCPT + 99 others); Sun, 22 Apr 2018 10:17:40 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58412 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932477AbeDVORe (ORCPT ); Sun, 22 Apr 2018 10:17:34 -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 0BE89CED; Sun, 22 Apr 2018 14:17:32 +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.4 54/97] IB/srp: Fix srp_abort() Date: Sun, 22 Apr 2018 15:53:32 +0200 Message-Id: <20180422135308.306965851@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135304.577223025@linuxfoundation.org> References: <20180422135304.577223025@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.4-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 @@ -2581,9 +2581,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; }